I am creating a plugin that uses a function update_post_metato update the price of a product change.
If I have product x( id:5) and option y( id:400), and I run update_post_meta(400,"_regular_price",13.00);It does not update the database. This is very strange when I click Edit Product(wp-admin), the updated price 13.00appears in the options bar, and I have to click Updateto update it for viewing by customers. Is this regular behavior, and if so, how to update the database immediately after the update_post_meta function is executed?
(Image) Price after update_post_meta() Summary page

.
(Image) Price after same update. Edit Product page

Here is my code for doing bulk updates
while ($loop->have_posts() ) : $loop->the_post();
global $product;
$variations = new WC_Product_Variable($product->post->ID);
$variations = $variations->get_available_variations();
foreach ($variations as $key => $variation){
foreach ($variation["attributes"] as $key => $attribute_value):
if($attribute_value == $variation_value):
update_post_meta( $variation['variation_id'], '_regular_price', $regular_price);
endif;
endforeach;
}
endwhile;
, Wordpress
http://wordpress.org/support/topic/update_post_meta-is-not-updating-the-actual-values?replies=1#post-5742842