Category configuration – Default Attribute Value
Objective
- As a Venture, I want to be able to set the default value for an attribute and get it sent to the Shop system with product create/update. E.g. to control the value of the returnable attribute.
To read about setting restrictions on categories, please, follow this link.
The configuration category_configuration/enabled must also be enabled.
An example of the configuration:
{ “returnable_attribute”: 279, “predefined_attributes”:[145, 26, 99] }
Where:
- _returnable_attribute_ – the ID of the Global Attribute; can be added to a document template as a placeholder.
- _predefined_attributes_ – an array of ID which defines the Global Attributes which will have fixed values.
- both are sent to the Shop with product update
Default Attribute Values
# | Description | Image |
1 |
Go to Administration > Catalog > Category Setup and switch to the “Category Configuration” tab.
|
|
2 |
Set the default value An overlay window pops up. You can choose the value of the attribute or decide on the inheritance. If you check “Inherited”, the value from the parent category will be applied. By default, all categories use inheritance from the root category.
As the attributes must be global and mandatory, you should set values for all categories. Otherwise, it will not be possible to create a product with an empty mandatory value.
You can set one default value for the root category and then specify other categories. |
|
3 | After the default values are set, go to Administration > Catalog > Attribute Set Editor and find the needed attribute. | |
4 |
Send to the Shop Set the value that was input in Step#2 as a “Fixed Value” for this attribute.
By default the attributes should be global and mandatory, otherwise, they will not be sent to the shop. However, non-mandatory attributes can be configured to be sent as well.
Read more about setting fixed values for attributes here. In case the “returnable_attribute” is defined in the configuration, a new placeholder will be available in the item table called {{return_policy}}. It can be added to the Invoice document. To read about template setup, please follow this link. |