SyliusElasticsearchPlugin
SyliusElasticsearchPlugin copied to clipboard
Same Attributes on multiple taxons brings to many filter values per taxon
We use same attributes for multiple taxons. Like for fixtures... Im sure if you sell t-shirts it is o.k. to see all the time all values from the attributes (Like Size S, M, L). And if you filter by S you may get "not items". But in our case is this a problem. We want to show only the attribute values from this taxon im in. I think there must be a option about this behavior.
This problem is very actual. Maybe you have any decision?
I solved it by:
\Repository\ProductAttributeValueRepository.php \RepositoryProductAttributeValueRepositoryInterface
added getUniqueAttributeValuesByTaxon function to filter attributes that only in current taxon (including sub taxon)
\Form\Type\ChoiceMapper\ProductAttributesMapper.php
call getUniqueAttributeValuesByTaxon instead
\Form\Type\ProductAttributesFilterType.php
due to the changes on ProductAttributesMapper, ProductAttributesFilterType required to update