I have a question regarding the new repositories used for filtering eCommerce products.
I am aware that the filtering has no sense of eCommerce context as such, so this will be more of a discussion of best practice.
I have a test site here: http://feenogfroen3.staging.nozebrahosting.dk/maerker/g-i/hummel with some filters made by using the facets specified in my repository. The use case is as follows:
When I choose a size from the dropdown I want to see the main products that have variants with the given size(s). Because of the way the customers sizes vary Size is based on a custom field that holds the sizes of the variant (A variant can cover more than one size). A size field could look like this: "140, 146, 152", which would give the 3 different values in the dropdown for the facet.
The facets work like a charm, but because we only want to show main products we have set isvariant = false as standard. This means however, that if we filter by a size that is not present on the main product we won't see it in the list (the reason there are any products at all was because we made the main product have the same value as the first variant).
As I see it there are 3 possibilities:
1: We set the size field on the main product so it has all the covered sizes of the variants. This has the drawback that if a size is being sold out (there are typically only 1 or 2 of each size), the product won't disappear from the product list unless we update the main product again, and update the indexes.
2: We specify in the query that if we have searched for a size we also search for isvariant=true, and get a product in the list for each variant, which will essentially make the same product appear many times.
3: We do a manual sorting and only show main products after the index has returned its results. That would however mess with the paging and numbering of products.
This is a specific case of a pretty generic feature many customers would expect. How would you go about doing a filtering of main products based on values on the variants of the product with the new repositories? I hope some of you have some good ideas :)
Regards
Kasper