Product Attributes
Product attributes allow you to add extra properties to products, such as colors, sizes, or any other custom attributes.
Structure
Attributes are organized in a two-level hierarchy:
- Categories: Groups of attributes (e.g., "Color", "Length")
- Values: Individual attribute values within a category (e.g., "Red", "Blue" for Color)
Database Structure
Tables
-
product_attribute_categories: Stores attribute categoriesidorganisation_idproduct_idname(category name)sort_order
-
product_attributes: Stores attribute valuesidorganisation_idproduct_idcategory_id(foreign key toproduct_attribute_categories)value(the attribute value)sort_order
API Response
When fetching products via the API, attributes are returned in the following format:
{
"id": 1,
"name": "Nails",
"attributes": [
{
"category_id": 1,
"category_name": "Length",
"values": [
{
"attribute_id": 1,
"attribute_name": "1CM"
},
{
"attribute_id": 2,
"attribute_name": "2CM"
}
]
},
{
"category_id": 2,
"category_name": "Color",
"values": [
{
"attribute_id": 3,
"attribute_name": "Red"
},
{
"attribute_id": 4,
"attribute_name": "Blue"
}
]
}
]
}
Usage in Appointments
When creating appointments, you can include selected attributes:
{
"products": [
{
"product_id": 1,
"attributes": [
{
"category_id": 1,
"category_name": "Length",
"attribute_id": 1,
"attribute_name": "1CM"
}
]
}
]
}
Managing Attributes
Attributes can be managed through the product detail page in the admin interface:
- Navigate to Products → Select a product
- Click on the "Attributes" tab
- Add categories and values as needed
- Use drag-and-drop to reorder values within categories