Collections Metafields in Shopify
If you’re a Shopify merchant, you would have customized your homepage or the product page. But have you ever tried customizing the collection page on your Shopify store?
If yes, let us know in the comments section what customizations you’ve made on your collection page and what result did you get.
In another case, you can modify your collection page by adding dynamic data to it. For this, you need to take the help of the Collection metafields in Shopify.
What is Collection Metafields in Shopify?
Like any other Shopify metafields, you can create custom fields in the collection pages too. It lets you store additional information for your collections in your e-commerce store.
Generally, the collection pages display a set of products that come in the same category. Oftentimes, we can find the name, description, and filters on the collection page, but to add additional information about your collection, you can use collection metafields.
How to Add Collection Metafields in Shopify?
Our goal is to display 20% on the product page and also a timer on the collection page. Let’s get started with the collection metafields in Shopify!
How to Create Collection Metafield Definition?
To show the sales details and timer on the product page in our store, we need to store metafields in 2 different values, that is:
- Sales Title
- Expiry Date & Time
Firstly, we will need to create a metafield definition that’s named “Offer Details” that will store the Sales title. Next, we will need to create a metafield definition that’s named “Offer Ends” that will store the Sale expiry date & time.
Now, let’s get started with creating metafield definition!
Steps to Create Collection Metafield Definition
Step 1: Once you’re logged in to your Shopify admin panel, go to Settings > Metafields.
Step 2: From the list of metafields types, choose Collections.
Step 3: Next, click on the Add definition button.
Step 4: Enter a name for the metafield definition. Here we’ll name it “Latest Offer”.
Step 5: Let the Namespace and key be as it is.
Step 6: You can add a description for your metafield definition, but it isn’t mandatory.
Step 7: Tick mark the Give access to Storefront API requests such that the metafield values are showcased on the storefront.
Step 8: From the Select content type, choose “Single line text”.
Step 9: Enter validation values. Here, we’ve entered the rating scale minimum as 30 and the rating scale maximum as 80. Click on the “Save” button to save the metafield definition.
You need to follow the same steps to create another metafield definition for the “Offer Ends”.
Adding Values to Collection Metafields in Shopify
After you’ve created the metafield definitions, now you need to add values to them.
Steps to add values to collection metafields
Step 1: Once you’re at the Shopify store admin area, go to Products > Collections.
Step 2: Click on any of the Collections. Let’s say we’re selecting jewelry.
Step 3: Scroll down to the page to find Metafield section on the collection page.
Step 4: Enter the value in the metafield as shown below.
Step 5: Lastly, save the changes.
How to Display Collection Metafields in Shopify?
After creating metafield definition and adding values to it, we can display the Sales details on any of the pages.
Steps to Show Shopify Collection Metafield
Step 1: From the Shopify admin area, go to Online store > Themes > Customize. This will take you to the theme editor.
Step 2: Now, open the Collection template by clicking on Collections > default collection.
Step 3: You need to create a section under banner and then click on Connect dynamic source icon on the right-side of the page.
Step 4: Select the metafield you want to connect to the section. Here, we are going to select “Latest Offers”. Underneath it, we’re going to select the metafield named “Offer Ends”.
Step 5: Click Save at the end.
So now you’re aware of what Collection Metafields are in Shopify and how you can add and manage the collection page using these metafields.
If you use these Collection metafields generously, you can see a hike in sales and revenue of your Shopify store.
Do you need more help customizing your Collection page for your e-commerce store? Or are you caught in the middle way of some steps? Whatever it may be, reach out to our Shopify experts to help you customize your store.