Filter by attributes with AND logic instead of OR

  • Impression eStudio
  • Topic Author
  • Offline
  • Premium Member
  • Premium Member
More
7 years 5 months ago #90289 by Impression eStudio
Filter by attributes with AND logic instead of OR was created by Impression eStudio
Hi,

I realized that when filtering products by selecting many attributes then the result shows products that include at least one of the selected attributes.
It would be nice the module "Eshop Advanced Search" to have an option to show products that include all the attributes.

At the moment I found a solution by changing only one line of code.
(I write the solution this way because the protection of the website does not allow SQL queries.)

In the file "components\com_eshop\models\search.php", go to line 239 that ends with code:
...IN (' . implode(',', $attributeIdsArr) . ')');
Make this line ending like the following:
...IN (' . implode(',', $attributeIdsArr) . ') GROUP BY pa.product_id HAVING COUNT(DISTINCT pa.attribute_id) = '.count($attributeIdsArr));

Please Log in or Create an account to join the conversation.

  • Giang Dinh Truong
  • Offline
  • Administrator
  • Administrator
More
7 years 3 months ago #92103 by Giang Dinh Truong
Replied by Giang Dinh Truong on topic Filter by attributes with AND logic instead of OR
Hello Impression,

In the early of New Year 2017, we will release EShop Filter Products which will replace EShop Advanced Search module. Please wait until that to use EShop Filter Products.

It's coming...

Sincerely, Giang

Please Log in or Create an account to join the conversation.

  • Giang Dinh Truong
  • Offline
  • Administrator
  • Administrator
More
7 years 3 months ago #92520 by Giang Dinh Truong
Replied by Giang Dinh Truong on topic Filter by attributes with AND logic instead of OR
Dear all,

Finally, EShop Products Filter is ready from version 2.5.0 of EShop. Please read more about it in the documentation at eshopdocs.joomservices.com/modules/eshop-products-filter-module and check demo for it at joomdonationdemo.com/eshop/

Please update EShop to have this great module.

Hope that this is really useful for all you guys.
Sincerely, Giang

Please Log in or Create an account to join the conversation.

Moderators: Giang Dinh Truong