woocommerce calculate and save price woocommerce calculate and save price wordpress wordpress

woocommerce calculate and save price


What I thing that you have an issue with Price that is showing in frontend. You need to update _price key if you want to reflect _regular_price in frontend.

Try this code:

if (!empty($area_price)){    update_post_meta($post_id, '_regular_price', esc_attr($area_price));    update_post_meta($post_id, '_price', esc_attr($area_price)); //<-- Add this line.}

UPDATED

Just add a higher priority to woocommerce_process_product_meta action hook, it 'll do the trick.

add_action('woocommerce_process_product_meta', 'woo_add_custom_general_fields_save', 99);

I have tested it and it is working fine.
Hope this helps!