# Display label/badge based on product/variant metafields

You can show a label or badge on different products containing same product / variant metafields.&#x20;

1. **Step one** : you create your product or variant metafields from your **Shopify Settings > Metafields and metaobjects > Add definition**:&#x20;

<figure><img src="/files/jGWhI0n14mApiaeDc7Y9" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/z7HiaaOpD209SBP3xBmT" alt=""><figcaption></figcaption></figure>

Then you click on the Copy to clipboard button to paste it inside the **namespace.key** input at the **Step three** below :&#x20;

<figure><img src="/files/CAeE34JFPeKm19nPORsZ" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/lOzWpsoH7epqDRXBJw9n" alt=""><figcaption></figcaption></figure>

\
2\. **Step two** : add values for each **Product metafield** or **Vairant metafield** from your **Shopify Products** tab, then you paste the values inside the corresonding value inputs at the below **Step three** : <br>

<figure><img src="/files/kG6zvIRuLhcI1XzyXZVS" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/OTK7LTJG5SAH9mmUFeuj" alt=""><figcaption></figcaption></figure>

\
3\. **Step three** : navigate to the **Display** tab to add the **Product metafield** or **Variant metafield** conditions with your recently created **namespace.key** fields and their **values** :&#x20;

<figure><img src="/files/JaMrzVt9WMrxbbbcRbQx" alt=""><figcaption></figcaption></figure>

> :warning: Ensure the Storefront API access is enabled from **Metafields and metaobjects** setting.<br>

<figure><img src="/files/JIe5U0d7GSi1wJUkkSxQ" alt=""><figcaption></figcaption></figure>

Click **Save** then check your label or badge on your website.

> ### **Need support?**
>
> If you do encounter any difficulty while proceeding these steps, don’t show any hesitation to contact us promptly via the email address [support@samita.io](https://help.samita.io/support@samita.io)


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.samita.io/badges-and-labels/display-label-badge-based-on-product-variant-metafields.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
