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
![](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiTLp0-0q28-n-9zG0MC5KlAPDmyPjuDUd7i2dgbW9NJP9AI3GMlWDwSkQPyphsTqIon7q5agtGiL_kfrDHMk1df__uHEfrNff2H_yRNwlOFOCiFXFidSNBuXvQ8jybfhx3ONgk9FT1ir0/s400/prestashop-how-to-set-discount-for-all-products-1.png)
How to find the id_category of Home(featured products)
Catalog Tab - Go any product detail
![](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjxSvwc4pKyELi-EMZ-VjOq0QQGF-pPWMQOoetYa8AsnjbErubAo92ZLdIRLeophr_RuvL1zhd967opioWNVypXONSkGNbHCvpYzAVggMnysvKZyZ4MVlCnDe0GqUF8L5xY8IeJqkos_Xg/s400/prestashop-how-to-set-discount-for-all-products-2.png)
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