> For the complete documentation index, see [llms.txt](https://docs.samita.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.samita.io/badges-and-labels/display-label-badge-based-on-product-variant-metafields.md).

# 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. 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. 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: <br>

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

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

3. Go back to **Sami Label** app > **Create badge**
4. Navigate to the **Products** tab > Choose Products matching conditions > add the **Product metafield** or **Variant metafield** conditions with your recently created **namespace.key** fields and their **values** :&#x20;

<figure><img src="/files/4cDqWlQisWVLwsVQcp5r" 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
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

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

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
