How to set up Metafield Badge in Product Grid element

Author: Jade Abit 276 views

In the Product Grid element, default badges such as Sale, Hot, and Sold-out will display the same for all product cards. But we can show a unique badge for each product card by using Shopify product metafields.
A metafield allows the merchant to add custom information to each product in Shopify Admin. For example, one product can show “Best Seller”, another can show “New Arrival”, and another can show “Limited Offer”. The app will read the metafield value from each product and display a corresponding badge on the product card. Products without a badge value will simply not display any badge.

image 92

This metafield badge feature can also be used in the Collection Product and Related Product elements. You can apply the same configuration steps for those elements as well.

Step 1: Open your page in EComposer, find the Product grid element -> Product card tab -> Turn on the Custom badge by ticking the Show badges checkbox. Now, you need to fill in the Display badge via metafield box.

image 91

Step 2: Go to Shopify Admin -> Settings to create metafield for your product.

image 48

Click Metafields and metaobjects -> Products

image 43

Step 3: Then click Add definition

image 44

Enter a name for this new metafield -> choose type Single line text, then copy the metafield code:

custom.custom_badge
image 78

Step 4: Navigate to Products -> Edit the Product -> Enter metafield content. For example, you can enter “Limited Offer“. Repeat this to add more badges to other products.

image 87

Step 5: Finally, go back to your page in EComposer -> Open the Product grid element -> fill in the metafield value in the box. The final code should be:

product.metafields.custom.custom_badge

As a result, the custom badge is showing up on top of the product image and it takes the content from your metafield in Shopify to display.

image 90

You can customize the design of the badge, such as color, text size, fonts,… under the Design tab. -> Custom badge

image 89

If you can’t follow the steps above, please check this video:

Leave a Comment

Enjoy a free 3-day trial. Then get your first month for $1. Try Now.