Here I introduce some of SQL to set discount for products in a batch way.
1. Set discount for all products.
Update `ps_product` set `reduction_percent`=YourPercentageDiscount,`on_sale`=1;
Please replace YourPercentageDiscount with your discount. For example 25 for 25 percantage.
2. Set discount for all products in a specific category
Update `ps_product` set `reduction_percent`=YourPercentageDiscount ,`on_sale`=1
where id_product in
(
select distinct id_product
from ps_category_product
where id_category=YourCategpryID
);
Please replace YourPercentageDiscount with your discount. For example 25 for 25 percantage.
Please replace YourPercentageDiscount with id_category. You can find id_category at you Back office.
If you want to set discount for all featured product, just replace YouCategpryID ID of id_category of Home which is 1 by default.
How to find id_category of your product categories
Catalog tab
How to find the id_category of Home(featured products)
Catalog Tab - Go any product detail
1 comment:
I know this thread is really old but...I have access to my database through my c-panel, is there a tool in there where I can add these statements? Or do I need to install mysql on my pc? any help appreciated :)
thanks,
Lisa
Post a Comment