The product itself than has the set of all attributes of the categories it is in. No problem for me because only a subset is filled in this case
I mean like that: the frontend asks the category which attributes are defined on it and shows filter for that:
So in a parent category there are less than in a more specified subcategory. I tried to have more filters in the parent - but this is realy confusing for users because the combinations are endless and often you have no results
Windsurf (year, usecase, manufacturer)
Windsurfboard = Windsurf + (volumen, material)
— Windsurfboard Wave = Windsurfboard + (fin setup)
Windsurfsail = Windsurf + (sailsize, color)
You can add (fin setup) to the AttributeSet of Windsurfboard and than you find them in the category above.
But if you add (fin setup) and (color) to the Windsurf, there are users that try to find red boards with truster fins
I generate a dict for the template with a list/range of all attributes of the variants. For example the sail sizes (every numeric) are a range [4.5, 9.4] in the template. Colors are [‘red’, ‘blue’, ‘yellow’] in the template. So I find a matching Template because the search value is in the list/range. Customer than has to choose on products detail page (and sometimes he searched a blue but than he sees the pink and he will buy this
For the filters on categories I generate a dictionary from all containing templates to not show filter values that are not available. So with two templates in the category with sail size [4.5, 9.4]/ [‘red’, ‘blue’, ‘yellow’] and [6.5, 10.4]/ [‘pink’, ‘orange’] the category has [4.5, 10.4] / [‘red’, ‘blue’, ‘yellow’, ‘pink’, ‘orange’] to build a slider, selector or whatever you want in the frontend.
I hope you can understand that, my english is really cruel