Woocommerce change the price of products in the database

Question

I’m trying to adjust the price of products in the database. I need to customize products that have custom taxonomy manufactory with id 270.

I can change a simple product with this code:

    UPDATE wp_postmeta
LEFT JOIN wp_term_relationships ON wp_term_relationships.object_id = wp_postmeta.post_id
SET
  wp_postmeta.meta_value = wp_postmeta.meta_value*1.05
WHERE
    wp_postmeta.meta_key = "_regular_price"
    AND wp_term_relationships.term_taxonomy_id = "270"

But it won’t change prices for variable products … Can anyone help me?

0
, uhercik 3 years 2019-10-30T07:28:30-05:00 0 Answers 75 views 0

Leave an answer

Browse
Browse