Обвновление цены товаров по SQL запросу Wordpress

Fruxr

New member
XNullUser
Joined
Oct 15, 2021
Messages
1
Reaction score
0
Points
1
NullCash
1
Обвновление цены по SQL запросу по определенному каталогу:
UPDATE wp_postmeta SET meta_value = ROUND(meta_value * 0.9, 2) -- Уменьшение цены на 10% WHERE post_id IN ( SELECT DISTINCT p.ID FROM wp_terms t INNER JOIN wp_term_taxonomy tt ON t.term_id = tt.term_id INNER JOIN wp_term_relationships tr ON tt.term_taxonomy_id = tr.term_taxonomy_id INNER JOIN wp_posts p ON tr.object_id = p.ID WHERE tt.taxonomy = 'product_cat' AND t.term_id IN (24, 177, 174) AND p.post_type = 'product' ) AND ( meta_key = '_regular_price' OR meta_key = '_sale_price' );
 
Top