Available in Premium Plan and above.
Metafields are the extended fields in entities that are used as an additional field in store's resources such as products, categories, orders etc.
To add metafields or additional field in an entity, click on Add New. On adding not to use spaces and extra special characters. The following window appears with the fields explained below:
Select the entity from the drop-down to which you want to add the metafield. For example: ms.sellers, ms.users, etc.
You can add multiple fields. Mention the field name, data type and their settings here.
Enter the name of metafield. For
Choose a data type for the fields from the drop-down. Following are the possible data types:
Clicking on the settings gear icon against data type lets you define the settings of the field.
It defines the edit type or display type of the field. This edit type is used as
Validation field allows you to define the validation rules for the field. You can define more than one validation rules for a field. Following are available validation rules:
Enter the description of the field for its API documentation.
Enter the example of the field for its API documentation.
Check this setting to make the field as required.
Check this setting to make the field hidden in the add and edit forms.
Select the checkbox if you want to make the field uneditable.
Select the checkbox if you want to hide the field in the add form.
Select the checkbox if you want to hide the field in the edit form.
Provide the text for the tooltip here, if you want to mention tooltip on the field.
It defines the placeholder for the field in the forms.
Specify the default value for the field if no value is passed.
You can define a function to show the field value in a specifically formatted way on the listing pages in the Admin Panel.
Provide the field and value here, if you want to make this a sub-field of a field.
If you want to apply event handler on the field, select the event as onChange, onLoad, onClick. You can define functions for the event in the handler.
When a metafield is added in the admin panel, you would want to display them on the storefront. To do so, you are required to make changes to the widget template from
For example, we have added a metafield as "metafield name". To display the metafield on the product page, go to the product widget in the design theme and provide the following code:
Some common uses cases of metafields are as follows:
You can add metafields in the products section to add extra fields such as size charts, loyalty points, etc.
You can add metafields in the Orders section to add extra fields such as estimated delivery time, delivery boy etc.
You can add metafields in the Sellers section to add extra fields such as longitude, latitude, etc.