I can not see how you manage the fact that a product can have multiple categories. But also that categories are defined as a tree structure.
I would make this in the opposite direction. That you define an attribute set on a category which enforce that all products in it (and in children category) must have this attribute set.
Why not but how do you manage the searching? What is actually stored in the variant Dict?
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
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