I am using WordPress 4.7.4 and woocommerce 3.0.5.

I updated _sale_price, _price, _regular_price using meta_id with below code

   $meta_tbl = $wpdb->prefix.'postmeta';
   foreach ($_POST['loop'] as $loop_k => $loop_v) {
        $wpdb->update(
            $meta_tbl,
                array( 'meta_value' => $loop_v['price'] ),
                array( 'meta_id' => $loop_v['price_meta_id'] ),
                array( '%d' )
            );
        $wpdb->update(
            $meta_tbl,
                array( 'meta_value' => $loop_v['regular_price'] ),
                array( 'meta_id' => $loop_v['regular_price_meta_id'] ),
                array( '%d' )
            );
        $wpdb->update(
            $meta_tbl,
                array( 'meta_value' => $loop_v['sale_price'] ),
                array( 'meta_id' => $loop_v['sale_price_meta_id'] ),
                array( '%d' )
            );
  }

but still shop page displaying old price of products, how it should be done properly ?

Read more here: How to update sale price woocommerce(3.0+) variable product?


Solution:

If you know the solution of this issue, please leave us a reply in Comment section, to update the question.


Wordpress related questions and answers: