Update all prices of products with 7%

PHOTO EMBED

Fri Jul 14 2023 11:42:10 GMT+0000 (Coordinated Universal Time)

Saved by @georgi_bogdanov #sql

UPDATE `wp_postmeta` 
SET `meta_value` = ROUND(`meta_value` * 1.24, 2) 
WHERE meta_key LIKE '%_price%' 
AND (meta_value > 0 or `meta_value` != '')
AND `post_id` IN (
    SELECT `ID` 
    FROM `wp_posts` 
    WHERE `post_type` = 'product' 
    AND `post_status` = 'publish' 
    AND `ID` = `post_id`
);
content_copyCOPY