A product attribute is a special type of custom field in the product details. For product attributes, OroCommerce enables you to manage and group attributes that are unique to a special product family. By adding the product attributes only to the product families they fit, you can limit the product data to the necessary characteristics.
For example, when your OroCommerce store sells TVs and T-shirts, these items share some generic attributes (e.g. name, vendor), and differ in the remaining attributes set. For example, there might be a Screen properties group that contains resolution, diagonal, and matrix that should be linked to the products in the TV product family. For the T-shirts family, the linked attribute group may have color, size, material, fit and care guidance (washing, ironing, dry cleaning, etc).
By default, OroCommerce comes with the following system product attributes:
Add new product attributes to introduce new custom parameters in your product details. Include product attributes into the new or existing attribute group in one or multiple product families.
System attributes are shared among all product families. You can reorganize the way system attributes are grouped, but you cannot remove a product attribute from the product family.
Create a Product Attribute¶
The creation of an attribute takes two steps:
- In step 1, you specify the basic properties, such as the attribute name and type.
- In step 2, you specify more advanced properties, some of which may depend on the selected attribute type.
To create an attribute:
Navigate to Products > Product Attributes using the main menu.
Click Create Attribute.
The following page opens:
Complete the following fields:
Field Description Field Name Fill in the field name that should be used to store the values of the product attribute. It should be between 2 and 22 characters long. Use only alphabetic symbols, underscore and numbers. Type
Select an attribute type.
Select one of the Fields type to store the value of the specific data type.
Select one of the Relations for the attribute to connect your custom entities as product information (these can be used for business intelligence and segments):
- Many to many – No limit of how many entity records of the selected type can be connected to the attribute, e.g. many custom entity records can be related to many products.
- Many to one – Attributes cannot have more than one entity record related to them, e.g. Products A-Z can relate to Promotion A. Product A cannot relate to multiple promotions. You can reuse the same promotion in multiple product details.
- One to many – One attribute can relate to many entity records, but every related entity record may be connected only once, e.g. Product A can be related to many promotions, but Promotion A cannot be related to multiple products.
The page with more product attribute details opens.
Proceed to create the attribute as described below.
Fill in remaining general information:
- Label – Enter the attribute label. It will be displayed both in the management console and in the front store.
- Description – When filled in, the description will be used as a field tooltip when the attribute appears on the forms.
Provide additional information for product attributes depending on their type:
Attribute Type Steps Select and Multi-Select
- Perform the following actions:
Click + Add next to Options.
Type in the option label. Enable the checkbox next to the default option.
Repeat for more options.
Click Do not set as default link to clear the Default flag.
Enter the maximum allowed file size and provide the thumbnail dimensions.
Enter the maximum allowed file size.
- Many to Many
- One to many
- Many to One
- Complete the following fields:
- Target Entity – Select the entity you wish to relate your current attribute to.
- Bidirectional – Select Yes or No. If set to Yes, the attribute and the selected entity will be interconnected.
- Related Entity Data Fields – Available only for Many to Many and One to Many relations. Select those fields of the entity selected in Target Entity which contain information that you want to see on the master entity record edit page. These could be a couple of important details in addition to the title which gives you the most important information about the related entity record. Hold the Ctrl key to choose several fields.
- Related Entity Info Title – Available only for Many to Many and One to Many relations. Select the fields of the entity selected in Target Entity by which the users can identify the related entity record. These fields serve as a title to the related entity record on the master entity pages. Choose these fields carefully. It would be a good idea to select a related entity name or similar information. On the view page of the master entity record, these fields will appear as links to the corresponding related entity record. On the edit page of the master entity record, you will see these fields as titles of the section that contains information selected in Related Entity Data Fields. Hold the Ctrl key to choose several fields.
- Related Entity Detailed – Available only for Many to Many and One to Many relations. Select those fields of the entity selected in Target Entity which contain additional information that you want to see on the master entity record edit page. The values of the fields selected will be available in the dialog box that appears when you click the title of the related entity on the master page edit page. Hold the Ctrl key to choose several fields.
- Target Field – Available only for Many to One relation. Select the field of the entity selected in Target Entity by which the entity records will be tied.
Fill in Import & Export details, if the products should be eligible for import/export:
- Column Name – Enter the name of the column (in a CSV file) that would represent the attribute you are creating. If left blank, a label will be used.
- Column Position – Type a number that corresponds to the position of the attribute in a CSV file.
- Use As Identity – Specify whether this column should be used as an identifier of the entity record. Select No, Only when not empty, or Always. If set to Only when not empty, the field may be omitted in the identity when it has no value.
- Exclude Column – Select No, if you want this field available for export, or Yes if you wish to exclude the column.
In the Other section, specify the configuration options for the product attribute view, search and use in the management console and front store.
Please note that additional options in the Other section depend on the type selected for the attribute (e.g. image, text, multi-select, etc.).
Once all options and information are provided, click Save.
If the created attribute is of a table column storage type, click Update Schema to reindex the data for search and filter.
The product attribute storage type is set to table column for the attribute with Select of Multi-Select data type, and also for the attribute of any type with Filterable or Sortable option enabled. If this step is omitted, the newly created attribute will not appear in the select attribute options in other areas of OroCommerce (e.g. product families configuration).