简体   繁体   中英

add a discount filter in layered navigation in Prestashop 1.6.*

I want to add discount filters like:

[]20%-30%
[]30%-40%

in the category page of my site. Any way to achieve the same? There doesn't seem to be much support regarding the issue out there.

The easiest way to achieve this (without any programming) is to create new features and link those to your product(s) which have a discount (like 20%-30% off, 30%-40% off, etc.). After you have done this, add those in the config of the blocklayered module so people can filter on products which have a discount.

Here's what I'm finally going to do (thanks to @Aurora and @Julien Lachal):

  1. I'm going to create new features and have it attributes like 20%-30%, 30%-40%, so on. Now, I'm not gonna go through each products which has discount enabled and assign them these features. Instead,
  2. I'm gonna do a little modification to the discount module to assign these features for me.
  3. As and when the discount module's core class is going to assign discount to my selected products, I'm gonna have it to call addFeaturesToDB(arrayFeatures()), which is productcore function, to the same products. Thanks.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM