Hi,
To increase all products by certain percentage per manufacturer in PhpMyAdmin is simple and has been covered before:
eg.
update `products` set `products_price` = (`products_price` * '1.05') WHERE `manufacturers_id` = '23';
Alas this only fully works with un-attributed products.
'products_attributes' does not have the manufacturer_id as a column as its in 'products'.
Any suggestions on how the above SQL query be changed, so as to also increase the attributes by the set percentage? (of the manufacturers products)
SQL for price updates
- zipurman
- PhoenixCart Developer
- Posts: 470
- Joined: Tue Oct 13, 2020 5:20 pm
- : Buy Me A Beverage
- Has thanked: 84 times
- Been thanked: 147 times
Re: SQL for price updates
Make sure you backup your database first, but the following should work:
update products_attributes SET options_values_price = (options_values_price * 1.05) WHERE products_id IN (SELECT products_id FROM products WHERE manufacturers_id = 23);
update products_attributes SET options_values_price = (options_values_price * 1.05) WHERE products_id IN (SELECT products_id FROM products WHERE manufacturers_id = 23);
zipurman
aka Preston Lord
-----------
Happy to help where I can
https://phoenixaddons.com
https://www.youtube.com/zipurman/ ** PHOENIX HOW-TO VIDEOS **
aka Preston Lord
-----------
Happy to help where I can
https://phoenixaddons.com
https://www.youtube.com/zipurman/ ** PHOENIX HOW-TO VIDEOS **