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

Collections hierarchy has no effect on sub-collections #158

Closed
lsimone opened this issue Sep 9, 2019 · 3 comments
Closed

Collections hierarchy has no effect on sub-collections #158

lsimone opened this issue Sep 9, 2019 · 3 comments
Assignees
Labels
type: bug 🐛 Something isn't working

Comments

@lsimone
Copy link
Contributor

lsimone commented Sep 9, 2019

Describe the bug
The nested collection filters products without taking into account the parent collection filtering.

To Reproduce
Just create a collection child inside a parent collection, bind them to different facets: the child could have products that are not in the parent collection.

Expected behavior
If I have a collection child C and a collection parent P, I expect that C filters products according to its own rules, but on a product pool that is the P's one, not the entire products database.

@lsimone lsimone added the type: bug 🐛 Something isn't working label Sep 9, 2019
@michaelbromley
Copy link
Member

Although there are e2e tests in place which should detect this, after much investigation there seems to be an edge case where a single matching FacetValue on a ProductVariant gets matched multiple times if the Product has more than one FacetValue.

I'm adding a test for this case so that it can be fixed and not regress in future.

@michaelbromley
Copy link
Member

Wow that was a tough one to fix! But great catch - it turns out the logic for facetValue-based collections was quite badly wrong and just happened to work in the range of scenarios in the e2e tests.

@lsimone
Copy link
Contributor Author

lsimone commented Sep 11, 2019

GJ!
It has been great to fix it before the stable ;-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug 🐛 Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants