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 capture number input from wordpress form into acf field in woocommerce
- Random Default Avatar Function
- How to do multiple searches (with logical OR) in WP_Query in hook pre_get_posts?
- Change the URL of an image from wp_get_attachment_image_src except in the frontpage
- Randomise upload filenames (or another solution to hide the original image URL from theft?)
- How do I display a user’s previous orders as a select box option on a product?
- Hide wordpress field if data is empty in post!
- How do you add customer capability after Woocommerce purchase?
- Change sign up fee in cart for subscription products WooCommerce
- How can I use wp_query to show all product data using just the products ID?
- wp_loaded hook block script enquequing
- write custom woocommerce templates and forms
- Change the site tagline (or similar) based on current page
- combine Code 1 with Code 2
- WooCommerce – Reset quantity input field when variation changes
- Trouble creating conditional PHP for nav menu items with children for custom Walker
- get current product name in functions.php
- Get stock by custom meta field on all Woocommerce variable products
- Make the first item as default on Woocommerce product category items list
- Custom Text in WooCommerce Order Processing Email Based on Products
- Woocommerce redirect thankyou page based on product ID doesn’t empty Cart
- Set a condition based on WooCommerce checkout city field while placing order
- Get WooCommerce product details and transfer them to a custom DB table
- woocommerce subscriptions – get expiration date [closed]
- Setting custom canonical urls
- tracking number field in Woocommerce order [closed]
- Handling Body class based on Template
- Only show search results with if current date is between two dates?
- database interactions using OOP
- Customizer: Output default value in Customizer CSS
- How to load a template-part based on a url wildcard?
- How to add just one specific page to widget without plugin?
- Remove one value in dismissed_wp_pointers?
- WooCommerce Related Products by Attribute
- create a select input with menus created on a custom options page
- Image as Sales Badge
- Taxonomy linked to pages
- WooCommerce – Email admin with new user details
- Remove an action hook within a Class
- Automatically remove a canceled order in Woocommerce
- How to pass arguments to add_action() or retrieve return value of called function?
- Create another “Display Site Title and Tagline” checkbox, “Header Text Color” setting and control
- Accessing data from a non-WP database/table within a page content
- Call global variable array() in woocommerce child/template
- WordPress blog post url on category page
- Remove price from Woocommerce variable product dropdown menu
- hook that when page is starting to load
- Changing layout with wp_customise
- WP dynamic featured image – Can’t get second featured image url
- Converting HTML Template to WordPress Theme
- Extending the WP_Widget_Text class
- How to change home or site url using action hooks or filter?
- Adding nofollow to a PHP generated Nav