How to Use Variant Metafields to Customize Label/Badge Display
Last updated
Last updated
In addition to product-level conditions, the BSS Product Labels & Badges app now supports variant metafields as a condition to display labels or badges. This allows you to show the right labels/badges for specific variants of a product based on custom data.
Variant metafields are a form of custom data attached to individual product variants in Shopify. While product metafields apply to the entire product, variant metafields allow you to store and target unique information per variant.
Variant metafields are created similarly to product metafields. Just make sure to select Variant as the resource type before defining your metafield.
Learn more: How to Create Product Metafields in Shopify: A Step-by-Step Guide
With variant metafields, you can ensure that a label/badge only shows up when a specific variant meets a metafield condition — giving you even more control and personalization across your storefront.
Go to Product Conditions > Select With specific Metafield(s)
Click Add Metafield
Choose Metafield type = Variant Metafield
Choose a Metafield from your existing Shopify Metafield list.
Our app supports many data types, including:
Single line text, Multi-line text
Integer, Decimal, Date and Time, Date
Dimension, Volume, Weight, True or False, Color (code)
Rating, Money
Enter the value you want to match for the Metafield. The app will then find products with matching values and display the corresponding label/badge
Examples:
Variant Metafield origin
= organic
: The label/badge will appear on variants where the origin
metafield is set to organic
Variant Metafield rating
= 5
: The label/badge will appear on variants where the rating
metafield is set to 5
.
Match all: Variant must match all Variant Metafield conditions to display the label/badge.
Match one: Variant only needs to match one Variant Metafield condition to display the label/badge.
Be sure to enter values correctly for your Metafields.
This feature is available only on the Platinum plan.
Ensure your variant has the Metafield with the value you set.
Labels/Badges with Variant Metafield conditions will be displayed on the product card if any variant of the product matches the condition.
You can also use product metafields as conditions to display labels or badges: How to Use Product Metafields to Customize Label/Badge Display?