Product attributes for Webshops

I have built into my shop modules the possibility of assigning attribute sets to a category. This has the advantage that

a) you don’t have to assign it to every template in the category
b) you can display a specific filter for the category in the shop frontend.

In addition, you can also assign attributes to the template that apply to all variants (e.g. use case).

Category: AttributeSet(use_case, material, volumen) - Surfboards
Template: Attribute(use_case) - Freeride
Variant: Attribute(material, volumen) - LTD, 125l
Variant: Attribute(material, volumen) - STD, 125l

Should this be an additional module, supplementing or even replacing the existing one?
I am looking forward to your opinion.

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

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 :slight_smile:

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 :slight_smile:

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 :slight_smile:

That’s exactly how it’s meant and how it’s done.

This may be an interesting feature but I do not see how it can be correctly enforced.

Starting to extract this part for review

1 Like