Metafields is a feature for your Shopify stores. It is comparable to custom fields in other applications. You can store extra information about your products, variants, collections, orders, blogs and shop.
Each metafield has following attributes:
- namespace: This is a technical term but it basically means a unique category name for your values. You can make it unique. For example, if you want to add more descriptions to your products. You can call the name space extra-description. It is better not to use space in any of the attributes.
- key: Describe what kind of information the value attribute is storing.
- value: The actual value you are storing. This can be text, number, urls etc.
- value_type: Can be either string or integer. If you are storing text information in the value field, select string. If you are storing numbers in the value field, select integer.
Once you have installed the application, you can use it to find products and variants, and other resources and use metafields. You can then add metafields using the UI.



After you have created metafields, you would often use it in shopify theme files to display such information on your product page, cart and many other places.
To add a product metafield with the following attributes to store extra description for your products.
An example
- namespace: product
- key: stocking update
- value: New stocking coming next month
- value_type: string
You can output the value of this metafield in product.liquid with this Liquid tag:
{{ product.metafields.product.extra-description }}
With Shopify 2.0 themes, you can add metafields directly to your theme using the theme editor without using Liquid.
See our article on how to modify your theme.
Liquid is a templating language used by Shopify for themes. For information on liquid, see Shopify help
For official information on the feature from Shopify. see https://help.shopify.com/en/manual/products/metafields
Comments
0 comments
Article is closed for comments.