Bulk Updating Woocommerce Variation Prices

admin

Administrator
Staff member
I'm trying to update woocommerce variation prices with a php/mysql script outside of wordpress.

I have a script that updates the
Code:
_price
and
Code:
_regular_price
value of one
Code:
product_variation
of a
Code:
product
in
Code:
wp_postmeta
table.

If I have <strong><em>more than one</em></strong> variation the correct price of the variation is displayed on the webpage - but the the price / price range coming from woocommerce`s price.php is not updated.

However, if I have <strong><em>only this one</em></strong> variation, the price in the table is updated, but not at all on the rendered webpage.

I also tried to edit the prices of the
Code:
product
itself. But: I still get the old price on the rendered webpage.

Basically I now have the same new price in these fields:

in <em>product-variation -> postmeta</em>:
Code:
_price, _regular_price

and in <em>product -> postmeta</em>:
Code:
_price, _regular_price, _min_variation_price, _max_variation_price, _min_variation_regular_price, _max_variation_regular_price

I couldn't find any other fields with a price - I'm stuck...

Did I miss anything? Is there any other table/field to be updated?

Thanks for your help!

-EDIT-

Maybe this helps: Apparently when having only one Variation my price is rendered with
Code:
echo $product-&gt;get_price_html();
instead of
Code:
echo $value['price_html'];
. So where is the price used in
Code:
$product-&gt;get_price_html();
stored?