Title: update the product fields
Last modified: May 3, 2017

---

# update the product fields

 *  Resolved [Siman-Tov Yechiel](https://wordpress.org/support/users/mastersgate/)
 * (@mastersgate)
 * [9 years, 1 month ago](https://wordpress.org/support/topic/update-the-product-fields/)
 * hi
    when im adding a new product and there is an error the fields not being saved
   and i have to write all over again.
 * im trying to make a function that will update the product fields when the page
   is being refreshed and there is an error… where i got wrong ?
 * this is a basick need that you didnt pay attention to it.
 * /**
    * Update the custom field when the form submits * * [@param](https://wordpress.org/support/users/param/)
   type $post_id */ function update_fields( $post_id ) { if ( isset( $_POST[‘_regular_price’])){
   update_post_meta( $post_id, ‘_regular_price’, $_POST[‘_regular_price’] ); } if(
   isset( $_POST[‘_sale_price’] ) ) { update_post_meta( $post_id, ‘_sale_price’,
   $_POST[‘_sale_price’] ); } if ( isset( $_POST[‘product_cat[]’] ) ) { update_post_meta(
   $post_id, ‘product_cat[]’, $_POST[‘product_cat[]’] ); } if ( isset( $_POST[‘product_tag[]’])){
   update_post_meta( $post_id, ‘product_tag[]’, $_POST[‘product_tag[]’] ); } if (
   isset( $_POST[‘post_content’] ) ) { update_post_meta( $post_id, ‘post_content’,
   $_POST[‘post_content’] ); } }
 * add_action( ‘dokan_product_updated’, ‘update_fields’, 10, 1 );

Viewing 4 replies - 1 through 4 (of 4 total)

 *  Plugin Author [weDevs](https://wordpress.org/support/users/wedevs/)
 * (@wedevs)
 * [9 years, 1 month ago](https://wordpress.org/support/topic/update-the-product-fields/#post-9095297)
 * [@mastersgate](https://wordpress.org/support/users/mastersgate/), We have already
   fixed this issue and the fix would be available in the next release 🙂
 *  Thread Starter [Siman-Tov Yechiel](https://wordpress.org/support/users/mastersgate/)
 * (@mastersgate)
 * [9 years, 1 month ago](https://wordpress.org/support/topic/update-the-product-fields/#post-9095924)
 * when it will the next relese ?
 * thank you
 *  Plugin Author [weDevs](https://wordpress.org/support/users/wedevs/)
 * (@wedevs)
 * [9 years, 1 month ago](https://wordpress.org/support/topic/update-the-product-fields/#post-9095954)
 * [@mastersgate](https://wordpress.org/support/users/mastersgate/), Please check
   the latest release. We have pushed an update already v2.6.1 🙂
 *  Thread Starter [Siman-Tov Yechiel](https://wordpress.org/support/users/mastersgate/)
 * (@mastersgate)
 * [9 years, 1 month ago](https://wordpress.org/support/topic/update-the-product-fields/#post-9096223)
 * grate job !!!
 * thanks a lot !!!

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘update the product fields’ is closed to new replies.

 * ![](https://ps.w.org/dokan-lite/assets/icon-256x256.gif?rev=3239229)
 * [Dokan: AI Powered WooCommerce Multivendor Marketplace Solution – Build Your Own Amazon, eBay, Etsy](https://wordpress.org/plugins/dokan-lite/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/dokan-lite/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/dokan-lite/)
 * [Active Topics](https://wordpress.org/support/plugin/dokan-lite/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/dokan-lite/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/dokan-lite/reviews/)

 * 4 replies
 * 2 participants
 * Last reply from: [Siman-Tov Yechiel](https://wordpress.org/support/users/mastersgate/)
 * Last activity: [9 years, 1 month ago](https://wordpress.org/support/topic/update-the-product-fields/#post-9096223)
 * Status: resolved