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
- Change comments form title on a page by page basis
- Woocommerce – How to get products which have a sale between 20% to 40%? [closed]
- Type hinting and void return question
- Customized title tag for each page in pagination?
- Woocommerce filter cart and category specific quantity [closed]
- How to create and work with custom data / tables (i.e., for arbitrary data)?
- Limiting woocommerce line_total decimal length
- How can I use wp_query to show all product data using just the products ID?
- If no products are on sale – hide ID or class
- wordpress + woocommerce display product with additional information [closed]
- Customizer: active_callback and sanitize_callback incompatibility?
- Redirect specific user role to specific site after login?
- Send multiple attachments with wp_mail in PHP
- custom url rewrite for wordpress
- Make a list of sites for each user in WPMU – switch_to_blog (display in SITE_ID: 1)
- Output Video Download Link in template
- Omit custom post type from wp-sitemap.xml based on meta key using wp_sitemaps_posts_query_args
- Get access to variable from previous pageview, excluding ajax-calls
- How to optimize update_post_meta?
- Create page template via functions.php?
- How to have different site identity logos on each page on Astra Theme [closed]
- CSS change in woo commerce Place Order Text [closed]
- Comapare get_user_meta value
- WooCommerce: Display product categories to make IF statement
- Update if post with specific title exists
- pass html code to worpdress
- How do I custom code the start page?
- Modify WooCommerce used to get all orders in dashboard
- WP_REST_Response – How to return Gzip answer and add Content-encoding header?
- woocommerce remove coupon link does not work
- Create Columns with Custom Walker and CSS Classes
- Replace a single variable with add_filter
- I am having issue in divi woocomerce checkout module. (DIVI theme)
- How can I check that the acf field value is not a duplicate when adding a post?
- Add a product category to a specific product via a button
- Adding an Anchor Link to a wordpress menu using WPBakery Page Builder
- Prevent header and footer from loading on specific pages with template or plugin
- Woocommerce display orders with products from specific categories to specific admins
- global $product is empty string when passed into function
- Trouble Accessing Gravity Forms API (GFAPI)
- Adding discount functionality to the cart
- Don’t update modified post date when user add a product review or comment?
- get_filtered_term_product_counts – Get product terms if any products
- How to add custom attribute to all outofstock and all instock products automatically?
- Add Product Permalink in woocommerce admin order page
- sessionStorage saves input value in browser but it is not loaded in the form field
- Create custom admin page with custom text fields
- WooCommerce – Add Shipping class below each product in Shopping Cart page
- Multisite – Display different header content based on which site is accessed
- How to remove image on single product and get product to span page?
- WordPress causing all code to be displayed on line 1. Receiving multiple errors after cleaning cookies and cache
- Getting custom field data from cart page to checkout page in woocomerce [closed]
- Grabbing value of input field inside of array
- How to set variable to specific field when querying
- WooCommerce Checkout Cart [closed]