Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Virtual Category Root Subtree doesn't apply rules to filtered category #3206

Open
rhoerr opened this issue Mar 7, 2024 · 1 comment
Open
Assignees

Comments

@rhoerr
Copy link

rhoerr commented Mar 7, 2024

Preconditions

Magento Version : Magento OS 2.4.6-p4 (latest)
ElasticSuite Version : 2.11.5.1 (latest)
Environment : Dev and production
Third party modules : N/A -- can reproduce the issue with Magento/blank theme and only Smile_Elasticsuite modules enabled

Steps to reproduce

  1. Create a virtual category with one or more Virtual Rule conditions (like 'is discounted')
  2. Select a Virtual Category Root
  3. Set "Generate Virtual Category Root Subtree" to Yes
  4. Open the virtual category on the frontend
  5. See that the category filter product counts show a limited number of products in each category
  6. Apply a category filter
  7. See that the actual product count on the filtered product list is higher
2024-03-07_110731

Expected result

  1. The virtual category with a category filter applied should also apply the virtual rules (like 'is discounted').

Actual result

  1. The filtered virtual category shows all products from the selected category, without virtual rules applied.

Before filter is applied: 'Gas Engines' shows 1 matching product

2024-03-07_105742

After category filter is applied: The product list shows 21 matches (all products in Gas Engines), which is more than the virtual category contained to begin with.

2024-03-07_105759

Applying the 'category' filter appears to be nullifying the virtual rules. This doesn't happen with other filters -- attribute filters seem to work fine. Only the category filter is affected.

@romainruaud
Copy link
Collaborator

@vahonc can you check this ?

You should be able to get the root category applied here :

https://github.com/Smile-SA/elasticsuite/blob/2.11.x/src/module-elasticsuite-virtual-category/Model/Layer/Filter/Category.php#L180

If $appliedRootCategory is empty, it might have been initialized unproperly here :

https://github.com/Smile-SA/elasticsuite/blob/2.11.x/src/module-elasticsuite-virtual-category/Controller/Router.php#L107

@vahonc vahonc self-assigned this Mar 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants