Close

SpecificationAttr Filtering: Only show products with this specific attribute

ChrisKaun
7 years ago
#13476 Quote
Avatar
  • 9
Hey, I have a problem with specification attribute filtering. Lets say I've created a few printer cartridges. One is named "Cartridge YELLOW - 200ml" and one "Cartridge GREEN - 200ml". I've created a specification attribute "Color" and added this to those cartridges. The "YELLOW" one got a color attribute of value "YELLOW", the "GREEN" cartridge with "GREEN" as its value. Both are allowed to be used as a filter. When I know enter my category page, where the filters are displayed, I have the filter-attribute "color" with the two values "yellow" and "green". If I tick only one of those, everything works as expected, but if I activate both attributes, both cartridges are displayed. My guess is that NopAjaxFilters uses a OR operator for these attributes. But I want to only display products with all attributes present, so for my example where GREEN AND YELLOW is present (which should return no products). Anyway to achieve this?
hristian.dimov
7 years ago
#13477 Quote
Avatar
  • Moderator
  • 386
ChrisKaun wrote:
Hey, I have a problem with specification attribute filtering. Lets say I've created a few printer cartridges. One is named "Cartridge YELLOW - 200ml" and one "Cartridge GREEN - 200ml". I've created a specification attribute "Color" and added this to those cartridges. The "YELLOW" one got a color attribute of value "YELLOW", the "GREEN" cartridge with "GREEN" as its value. Both are allowed to be used as a filter. When I know enter my category page, where the filters are displayed, I have the filter-attribute "color" with the two values "yellow" and "green". If I tick only one of those, everything works as expected, but if I activate both attributes, both cartridges are displayed. My guess is that NopAjaxFilters uses a OR operator for these attributes. But I want to only display products with all attributes present, so for my example where GREEN AND YELLOW is present (which should return no products). Anyway to achieve this?


Hi Chris,

Yes, you are right - the plugin uses OR logic operator. Unfortunately, it is not a configurable option and it cannot be changed to "AND".

Hope this helps!
Regards,
Hristian Dimov
Nop-Templates.com