Attribute Set

Attribute sets are used to group attributes into groups that are easily identifiable.

For example T-shirt could be an attribute set that has color and size as attributes. Further more, these attribute sets are used to easily select groups of products.

Thus, where attribute groups are about grouping attributes, attribute sets are about grouping products.

Every product can only belong to one product attribute set.
A car will never be a ship. You can however fine-tune attribute sets to your liking. For example, instead of a general-purpose attribute set called car, you can make a more specific attribute set called Volvo.

Attributes

In order to best explain attributes, we can use a single product as an example. Let's say we have a product, which is a t-shirt called "Awesome T-shirt".
We would like to register some of its properties, so we can display those in our store.

We'll start with the following:

  • Color
  • Gender
  • Size

Those are called attributes. Thus, we can set up an attribute set called T-shirt and assign these three attributes to it.
The actual value for each attribute of the Awesome T-shirt is called a property.

Consequently, the "Awesome T-shirt" is part of the T-shirt attribute set, in which we can register Color, Gender and Size.
The actual values for those attributes, for example Red, Female and Medium, are the properties of our product.

Attributes can be reused across attribute sets, e.g. a sweater is a different attribute set, but it can also have a size attribute.

Attribute Types

We have five different types of attributes:

  • number
  • boolean
  • select*
  • multiselect**
  • string (text)

*For example, you have the quality attribute and you want to give it a fixed list of options.
**For example, the colour attribute, where you can select more than one option.

Attribute options

Attribute options are the possible values of attributes.
For example: if size has a specific set of possible values (Small, Medium, Large, etc.), every one of these values would be an attribute option.
Attribute options are only needed if the attribute can be defined this way. Price, for example, cannot reasonably be defined as a set of possible values when working with many products. Price would be a free field, accepting a string or int types as values.

Attribute groups

Grouping of attributes is used to create a logical grouping of...... you guessed it attributes.
For example let's say you want to give a product dimensions, so you create a width attribute, length etc. Grouping them together in a group 'dimensions' makes sense.

API calls

Endpoint: /attribute-sets


Endpoint Method Payload
/attribute-sets GET
/attribute-sets/:set GET
/attribute-sets POST attribute set payload
/attribute-sets/:set PUT update attribute set payload
/attribute-sets/:set DELETE
/attribute-sets/:set/property GET
/attribute-sets/:set/property POST attribute set property payload



Attribute set payload
{
    name*: string
}

*required

Update attribute set payload
{
    name: string
}

*required

Attribute set property payload
{
    property_id*: int^,
    value
}

*required
^if there is a product then a selection from an array of its properties ids instead

Reference available fields:
Name Type Remarks
name string(250)
code* string(250)
updated_at date
created_at date
deleted_at date

* is required.

Endpoint: /product-attribute


Endpoint Method Payload
/product-attribute GET
/product-attribute/:attribute GET
/product-attribute POST attribute payload
/product-attribute/:attribute PUT update attribute payload
/product-attribute/:attribute DELETE



Attribute payload
{
    "name*": string,
    "code*": string,
    "input_type*": number|select|multiselect|boolean|text|list,
    "productattributegroup_id*": integer,
    "options": array
}

*required
~ must be unique in table/column

Update attribute payload
{   
    productattributegroup_id*: int|(productattributegroup/id)**,
    code*: (productattribute/code)~,
    name*: string,
    inputtype: [
        'number', 
        'select', 
        'multiselect', 
        'boolean', 
        'text', 
        'list'
    ],
    options: array
}

*required
~ must be unique in table/column

Reference available fields:
Name Type Remarks
productattributegroup_id* integer(11) attribute group
code string(39)
input_type string(255)
searchable tinyint(1)
is_global integer(11)
updated_at date
created_at date
deleted_at date

* is required.

Endpoint: /product-attribute-option


Endpoint Method Payload
/product-attribute-option/:attribute GET
/product-attribute-option/:attribute POST attribute option payload
/product-attribute-option/:option PUT update attribute option payload
/product-attribute-option/:option DELETE



Attribute option payload
{
    value*,
    code,
    default*: boolean
}

*required

Update attribute option payload
{
    value*,
    code,
    default*: boolean
}

*required

Endpoint: /product-attribute-group


Endpoint Method Payload
/product-attribute-group GET
/product-attribute-group/:group GET
/product-attribute-group POST attribute group payload
/product-attribute-group/:group PUT update attribute group payload
/product-attribute-group/:group DELETE



Attribute group payload
{
    "name*": string,
    "sort_order": integer,
    "default": boolean
}

*required
** must exist in table/column
~ must be unique in table/column

Update attribute group payload
{
    name: (productattributegroup/name)~,
    sort_order: int,
    default: boolean,
}

*required
** must exist in table/column
~ must be unique in table/column

Reference available fields:
Name Type Remarks
name string(250)
code* string(250)
icon string(250)
default string(250) This is a flag set to 1 when the group is default seeded with Daalder
sort_order string(250)
updated_at date
created_at date
deleted_at date

* is required.

© 2021 Daalder. All rights reserved.