Skip to main content

Attributes

Attributes are custom fields that allow you to enrich products with specific and variable information. Although they share some characteristics with Tags, the key difference lies in the dynamic nature of the value.

While Tags are used for constant and predefined values (like "Red" or "XL"), Attributes are defined as a "structure," and their value is entered manually for each individual product or variant, as it almost always changes from one unit to another.


When to Use Attributes?

The choice between Tags and Attributes depends on the cardinality of the value:

  • Tags (Constant Values): Ideal for properties shared by many products. Using a Tag for "Color" is the correct choice because the domain of values is limited (White, Black, etc.).
  • Attributes (Unique Values): Ideal for information that is specific to that particular item and would not make sense to define "a priori" as fixed options.

Practical Examples

Use CaseRecommended Data TypeExample Value
VIN (Car Chassis)Attribute1FA6P8CF5G...
Used MileageAttribute (Number)56,680
Registration DateAttribute (Date)15/05/2022
Technical NotesAttribute (String)"Slight scratches on left door"

Dynamic Search and Filtering

Unlike Tags, which offer filters based on static labels, Attributes enable more advanced search logic based on the nature of the data:

  • Range Filters (Intervals): For Number or Date type attributes, the Catalog APIs allow for interval-based searches. For example, you can filter "all cars with mileage between 10,000 and 50,000."
  • Textual Match: Attribute values are indexed for global search. If you search for the exact value of a VIN or a specific mileage, the system will return the corresponding product.
  • Sorting: You can sort the products in your catalog based on an attribute (e.g., from newest to oldest via the registration date).

Properties and Localization

Attributes also enjoy a high level of technical customization:

  • Localization: Both the attribute name and the value entered in the product are localizable for each active language.
  • Type and Label: You can define whether the attribute is a String, a Number, or a Date and add a Label (unit of measurement) such as "km" or "Months."
  • Icon and Position: As with Tags, you can assign an icon from React Icons and establish the display hierarchy in the front-end.

Common Error: Attribute vs. Tag

Defining an attribute for "Color" is considered a modeling error. If the value is an option that repeats across multiple products, use Tags. If the value is a data point that you would enter manually each time in a different way (like a chassis number), use Attributes.