How to Add Multiple Attribute Values?
In Omnitron, attributes play a crucial role in defining product characteristics, enabling filtering in the storefront, and integrating with external systems like ERPs. However, there is a key limitation: a single attribute on a product cannot hold multiple values. This tutorial walks you through the recommended approach for handling such cases by using separate boolean attributes for each value. You'll learn how to create boolean attributes via the Omnitron interface or API, configure attribute mappings for ERP integrations, and ensure that these attributes are correctly reflected in product data and storefront filtering. Whether you're managing attributes manually or through an integrator, this guide provides the complete workflow to ensure accurate attribute configuration.
Understand Attribute Value Limitation
In the current Omnitron structure, attributes on a product cannot have multiple values.
If it is desired for an attribute to have more than one value on a product, a separate boolean attribute must be created for each value.
Create Boolean Attributes via Omnitron
Go to Products and Catalogs > Product Attributes page in Omnitron.
Click the + New Attribute button to create a new attribute.
In the form that opens:
Set the Product Attribute Input Type field to
Boolean
.If the attribute will be used for filtering in the shop, set the Is Filterable? field to
Yes
.Set the Pre Attribute field to
No
.
Example:

Instead of using the interface, a POST
request can be sent to the following endpoint:
{{omnitron_url}}/api/v1/attributes/
Example Body:
{
"key": "concern_oily",
"data_type": "bool",
"default_value": null,
"is_required": false,
"is_visible": false,
"is_searchable": false,
"is_filterable": true,
"is_variant": false,
"is_variant_listable": false,
"name": "Oily",
"is_form_required": false,
"is_form_field_required": false,
"erp_code": "concern_oily",
"pre_attribute": false,
"is_offer": false,
"is_localizable": false
}
If Attribute Value Will Be Sent from ERP
If the brand is using pending product:
i. Create Pre Attributes
Go to Products and Catalogs > Product Attributes in Omnitron.
Click + New Attribute to create a new attribute.
In the opened form:
Match information with the original attribute.
Set Pre Attribute field to
Yes
.
Example:

ii. Map Pre Attributes
Go to Integration > Mapping and click + New Rule Set.
In the empty mapping row at the end of the page:
Select Pre Attribute in the ERP Features field.
Select the Attribute to be mapped in the Attributes field.
Select the Pre Attribute in the Default Attribute field.
Instead of using the interface, a POST
request can be sent to the following endpoint:
{{omnitron_url}}/api/v1/mappings/
Example Body:
{
"mapping_type": "attribute_value",
"value_dict": {
"attributes__erp_concern_oily__isnull": false
},
"default_value": {},
"default_attribute": "erp_concern_oily",
"priority": 1,
"mapping_key": "Oily",
"create_all_kind": false
}
If the brand is using an Integrator:
i. Update Product Flow in Integrator
Add newly created attributes to the Product Flow under Integration Flows in Integrator.
If needed, update the script in the flow to modify data coming from ERP.
ii. Map ERP Values to Omnitron Attributes
On the Mapping page of the flow:
Create mapping between ERP values and Omnitron attributes. (If using pending product, use pre attributes.)
Add Attributes to Attribute Sets
To reflect the newly added attribute on products, it must be added to the relevant attribute sets.
Go to Products and Catalogs > Product Attribute Sets in Omnitron.
Edit the attribute sets where the attribute will be used.
If attribute should not be used for filtering on certain products, set Is Filterable? to
No
in those attribute sets.
Reflect Attribute Values on Products
If the brand is using ERP:
Add new attributes to the product in the ERP system.
If ERP is not used:
Enter attribute values via Omnitron.
Enable Filtering by Attribute in the Shop
In order for products to be filterable by the newly added attributes in the shop, filters must be added to the URL using the attribute name and value.
Example:
/?attributes__concern_oily=True&attributes__concern_sensitive=True
Last updated
Was this helpful?