In order to filter the products visible online based on criteria other than product category and price, you can create attributes and associate attribute values with the products.
For example, for a clothing brand, you can create a "color" attribute with each of the clothing colors available for rent as attribute values. Customers can then specify that they are looking for a blue dress, for instance.
For a sports equipment brand, if the categories pertain to the type of sport offered, the attributes could indicate whether the equipment is designed for men, women, or children.
You can think of numerous application cases: collection, brand, target audience age, material, eco-friendliness, country of production, season, sleeve length, and so on.
Create an attribute and its possible values
1. Sylius > attributs > Create
2. Two types of filters are currently possible:
- Checkbox Attribute Type
This is a feature that the product either has or doesn't have. In other words, if the checkbox is selected (checked), the product possesses that attribute, and if it is unselected (unchecked), it does not have that attribute.
Example: Attribute "Eco-friendly Product": The product is either eco-friendly or it's not (although one can debate this notion).
- Select Attribute Type
This type can have various values.
Example: Attribute "Color" can have values like red, blue, green, etc.
3. Fill in the code without spaces; it won't be displayed.
4. Fill in the attribute name; this will be displayed in the filter panel (in all languages available on your website).
5. For the "Checkbox" type, that's it; click on "Create."
6. For the "Select" type, fill in the following:
- "Multiple": If each product can have multiple values for the attribute (for example, if you can say that a t-shirt is both red and green).
- "Minimum Entries": The minimum number of values of this attribute that a product (for which you have activated this attribute) must have -> refer to part 2 of this article for clarification on this point.
- "Maximum Entries": The maximum number of values of this attribute that a product can have. For example, a product could be Yellow, Blue, and Red.
- Click on "+ Add" for each value you want to create, give them names, and translate them if necessary.
- Click on "Save Changes."
Assign attribute values to products
Once an attribute and its values have been created (or just the attribute for checkboxes), you need to go into each product page to indicate which values it has. There's no need to enter each product variant.
1. Sylius > Products > Edit
2. Click on Attributes in the left-hand list
3. Select the attributes that apply to this product and click on "Add Attributes"
4. Next, choose an attribute value, or multiple values by holding down the Ctrl key and clicking on all the values.
5. Click on "Apply to all," only if you are using other languages, to apply this selection in the other languages.
6. Save the changes.
Was this article helpful?
That’s Great!
Thank you for your feedback
Sorry! We couldn't be helpful
Thank you for your feedback
Feedback sent
We appreciate your effort and will try to fix the article