> For the complete documentation index, see [llms.txt](https://ta-product-labels-and-badges.tech-arms.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://ta-product-labels-and-badges.tech-arms.io/setup-conditions/product-conditions/include-products/how-to-use-variant-metafields-to-customize-label-badge-display.md).

# How to Use Variant Metafields to Customize Label/Badge Display

In addition to product-level conditions, the **TA 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.

### 1. What is a Variant Metafield? <a href="#id-1.-what-is-a-variant-metafield" id="id-1.-what-is-a-variant-metafield"></a>

**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](/faqs/pro-tips/how-to-create-product-metafields-in-shopify-a-step-by-step-guide.md)

### 2. Why Use Variant Metafields for Labels/Badges Display? <a href="#id-2.-why-use-variant-metafields-for-labels-badges-display" id="id-2.-why-use-variant-metafields-for-labels-badges-display"></a>

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.

### 3. Step-by-step Guide <a href="#id-3.-step-by-step-guide" id="id-3.-step-by-step-guide"></a>

#### 1️⃣ Step 1: Choose Display Condition Type <a href="#id-1-step-1-choose-display-condition-type" id="id-1-step-1-choose-display-condition-type"></a>

Go to **Product Conditions** > Select **With specific Metafield(s)**

<figure><img src="https://product-labels-docs.tech-arms.io/~gitbook/image?url=https%3A%2F%2F340561356-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FNvBHInFsm4Ct08xZ2f0e%252Fuploads%252Fgit-blob-08b1dadaf976f608f5f3ed0cdc78e3e9e7ea58ed%252Fimage%2520%2815%29.png%3Falt%3Dmedia&#x26;width=768&#x26;dpr=4&#x26;quality=100&#x26;sign=9ce84c47&#x26;sv=2" alt=""><figcaption></figcaption></figure>

#### 2️⃣ Step 2: Choose the Metafield You Want to Use <a href="#id-2-step-2-choose-the-metafield-you-want-to-use" id="id-2-step-2-choose-the-metafield-you-want-to-use"></a>

* Click **Add Metafield**
* Choose **Metafield type = Variant Metafield**
* Choose a Metafield from your existing **Shopify Metafield list**.

<figure><img src="https://product-labels-docs.tech-arms.io/~gitbook/image?url=https%3A%2F%2F340561356-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FNvBHInFsm4Ct08xZ2f0e%252Fuploads%252Fgit-blob-076159b027f3d348635f3cda471e8b4ecca76158%252FVariant%2520metafield%25201.gif%3Falt%3Dmedia&#x26;width=768&#x26;dpr=4&#x26;quality=100&#x26;sign=ae7e730b&#x26;sv=2" alt=""><figcaption><p>Select Variant Metafields</p></figcaption></figure>

* 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

#### 3️⃣ Step 3: Enter the Value You Want to Match <a href="#id-3-step-3-enter-the-value-you-want-to-match" id="id-3-step-3-enter-the-value-you-want-to-match"></a>

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

<figure><img src="https://product-labels-docs.tech-arms.io/~gitbook/image?url=https%3A%2F%2F340561356-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FNvBHInFsm4Ct08xZ2f0e%252Fuploads%252Fgit-blob-dd4e99352fe99ff4f685d1d48819dd732b02ebf9%252Fimage%2520%2816%29.png%3Falt%3Dmedia&#x26;width=768&#x26;dpr=4&#x26;quality=100&#x26;sign=9136d6dd&#x26;sv=2" alt=""><figcaption><p>Enter the value you want to match</p></figcaption></figure>

**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` .

#### 4️⃣ Step 4: Choose Matching Option <a href="#id-4-step-4-choose-matching-option" id="id-4-step-4-choose-matching-option"></a>

* **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.

<figure><img src="https://product-labels-docs.tech-arms.io/~gitbook/image?url=https%3A%2F%2F340561356-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FNvBHInFsm4Ct08xZ2f0e%252Fuploads%252Fgit-blob-b09a1f68c71e7fa1c056f22363c15cba16277251%252Fimage%2520%2817%29.png%3Falt%3Dmedia&#x26;width=768&#x26;dpr=4&#x26;quality=100&#x26;sign=45de569e&#x26;sv=2" alt=""><figcaption><p>Matching Options</p></figcaption></figure>

#### 5️⃣ Step 5: Save and Preview on Your Storefront <a href="#id-5-step-5-save-and-preview-on-your-storefront" id="id-5-step-5-save-and-preview-on-your-storefront"></a>

### 4. Pro Tips <a href="#id-4.-pro-tips" id="id-4.-pro-tips"></a>

* Be sure to enter values correctly for your Metafields.
* Ensure that Storefront API access is turned on in the Metafield.

  <figure><img src="https://product-labels-docs.tech-arms.io/~gitbook/image?url=https%3A%2F%2F340561356-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FNvBHInFsm4Ct08xZ2f0e%252Fuploads%252FqMoWxkPK6DfHfO15398t%252Fimage.png%3Falt%3Dmedia%26token%3D95b9acae-94a8-4779-a9c6-92a769aff176&#x26;width=768&#x26;dpr=4&#x26;quality=100&#x26;sign=df173af8&#x26;sv=2" alt=""><figcaption></figcaption></figure>
* This feature is available from the **Pro** 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?](/setup-conditions/product-conditions/include-products/how-to-use-product-metafields-to-customize-label-badge-display.md)
