Try this updated code. It should work: You can check this url for more information https://awhitepixel.com/blog/woocommerce-product-data-custom-fields-tabs/
add_action( 'woocommerce_product_options_general_product_data', 'add_custom_fields_seo');
function custom_fields_save_seo( $post_id ){
$product = wc_get_product($post_id);
$num_package = isset($_POST['_deposit_price']) ? $_POST['_deposit_price'] : '';
$product->update_meta_data('_deposit_price', sanitize_text_field($num_package));
$product->save();
}
add_action( 'woocommerce_process_product_meta', 'custom_fields_save_seo' );
Related Posts:
- Adding new divs with custom classes to products on WooCommerce shop page [closed]
- WordPress and event-driven programming – what is it about?
- Receiving Stripe Webhooks on a wordpress website
- Remove Woocommerce product link
- Creating custom Woocommerce attribute taxonomies from a plugin
- Display a selected custom product option in WooCommerce cart
- WooCommerce: How to display item meta data in email confirmation using woocommerce_order_item_meta_end
- How to remove “out of stock” variation options from size dropdown in woocommerce?
- How to Remove a Filter from the Admin List Table?
- Woocommerce, recognize the loop of related products
- Replace existing content from specific WooCommerce admin orders list column
- How To Change The Html of Products filtration sidebar in Woocommerce?
- Add attribute / custom attribute to product in woocommerce
- WooCommerce: Add Payment Gateway Field to Webhooks [closed]
- How to add a second ‘place order’ button in WooCommerce [closed]
- Setting up 2 SMTP accounts: 1 for wordpress and 1 for woocommerce
- Reload part of checkout on changed shipping method
- Woocommerce: hook action/filter I could use to add variation id and price with each attribute opt on WooCommerce Rest api
- Add a product to checkout via form
- Is it possible to intercept all ajax requests and get the parameters and the returns?
- user_profile_update_errors hook not executing
- Modify custom field input data before creating a new post
- How to remove woocommerce_breadcrumb() from do_action( ‘woocommerce_before_main_content’ ); [closed]
- How to get private property in parent class into extended class?
- After disabling WPML multi currency, the currency is still handled by the WPML
- How do i wrap woocomerce attribute in list?
- How to sort WooCommerce products page by latest in-stock items first?
- Variation prices breakdown only for single product page
- Removing “There is no account with that username or email address.” error message in “/wp-login.php?action=lostpassword”
- Display custom field value in woocommerce variable product via jQurey
- How do I know if the user is a customer?
- Adding custom field to product category and show it to shop/category shop page
- I want to fusion the product columns in email table order
- Add a new view on the Woocommerce account page
- How can I update the price when someone enters postcode or zip code in woocommerce checkout page?
- Discount in the specific product title using keyword ( Woocoommerce )
- How do I remove an action hook inside a class that is called by another class?
- Need to forward Data from WooCommerce Webhook sent to same site WordPress REST API custom endpoint
- Add custom attribute to product’s HTML to woocommerce cart page
- Clone the “proceed to cart” button and place it above checkout on the cart page, but only appear display size is 320px
- How to add custom checkout field in user details mail template
- Change Checkout “Place Order” text if cart has a specific product
- Send a custom notification to customer on WooCommerce cancelled order status
- Woocommerce linking variations
- Woocommerce – add tracking code to another email template
- Woocomerce custom add to cart button edit functionality [closed]
- How to change product title color in shop page if product has specific product tag (Woocommerce)?
- How to add product in woocommerce with php code [closed]
- Using register_activation_hook in classes
- Show the most popular post per week
- Add a class to links in the visual editor (how to get old dialog back)
- How to get the original price of the product in woocommerce?
- Overriding a theme redux file in child theme
- Widgets not showing in my custom theme
- Writing scripts using WordPress / WooCommerce classes?
- How to make custom total price reactive in navigation
- How to get 2 or multiple custom post types in wordpress functions.php
- Change description on specific WooCommerce product status change
- Trouble creating conditional PHP for nav menu items with children for custom Walker
- Woocommerce redirect thankyou page based on product ID doesn’t empty Cart
- tracking number field in Woocommerce order [closed]
- Why ajax doesn’t work on certain wordpress hooks?
- How to obtain the current website URL in my theme?
- Function returns text instead of html [closed]
- Theme activation hook in php class
- Echo title attribute php
- Changing the order of custom fields in the dashboard for Woocommerce variable products [closed]
- woocommerce wc_create_order(); is creating multiple orders instead of one?
- List of Events with Multiple Dates: Only NEXT Date
- How to restrict shipping zone in a specific interval time
- Hide specific product from Woocommerce if the logged-in user has already enrolled into the course
- Hide A Class and Add Custom HTML Code Using WordPress
- get orders of today’s date
- product_type_options get saved value [closed]
- Preserving backslashes in post_content
- Add to cart quantity dynamic
- Dynamic “home” image and URL based on current folder
- Change WooCommerce currency programmatically on AJAX request
- Woocommerce textarea format ignored
- How can I add another row to the total field in WooCoommerce cart, checkout and recipe mail?
- Add missing alt tag to featured images for “storefront” theme
- How to limit functionality of a woocommerce plugin to only certain user role?
- Use PHP code in Menu Admin Section
- Passing link parameter values to form
- How to show all of aspecific post type that has taxonomy and a specific term
- Display a list of users with avatar filterable with alphabets
- How does one programmatically manage posts from a external php script?
- How to get the rating value of each comment
- Product Category Page in Full Width
- After declaring woocommerce theme support products are no longer displayed
- Replace the image of a product with its video in the shop page
- Show button in header when product custom field is not empty
- understanding wp_next_scheduled
- WordPress 6.1.1 UTF8 Slug Limit Increase
- Woocommerce Convert existing order to the cart
- How to change shipping method title based on cart amount?
- How to add SKU and remove product title from WooCommerce url?
- Product Search in search.php
- using custom pages for myaccount in woocommerce
- How to add query string at the end of sitemap Yoast SEO