# Custom badges

Story theme allows you to create your own unique product badges to associate with any of your products. When using Shopify's dynamic source feature (also known as metafields), you can create individual product badges for any of your products.&#x20;

![Example of custom badge call "Best Seller" assinged to a product](/files/cYhR2c2CW99Jnrq2u5gS)

Once a badge metafield is defined (see instructions below), any of your products can display a custom badge. There are no limits to the number of badges you can create and use. All your products will be able to display a custom badge or use the built-in badges for sales and out-of-stock inventory.&#x20;

## How to setup

### Quick setup for experienced users

The most important part of setting up this metafield is to use the namespace and key of:

```json
theme.badge
```

See the example here:

![](/files/L3Xb5z32bkwnaD1jy9xp)

### Full detailed step-by-step setup

The first step is to define a custom metafield that Story theme supports.&#x20;

Start in your Shopify Admin -> Settings and choose Metafields from the left panel and then click on **Products** (click images to zoom):

![Under Metafields, click on Products ](/files/ciMq1FK443C5tJ5wpMET) ![Use the Add definition button to begin](/files/zDUnbkrm2OX78aXvNO5Z)

Choose the **Add definition** button to begin. Choose a name, we'll use badge. Next, we will use a custom namespace. This is **required** for custom badges. Change the default namespace from `my_fields` to **`theme`**&#x20;

![Change from my\_fields to theme](/files/fSRrgzx0QZuMccMXFGCK)

Change to:

{% hint style="success" %}
theme.badge
{% endhint %}

Example:

![Don't skip this step](/files/L3Xb5z32bkwnaD1jy9xp)

Add a description and choose **Select content type**.

&#x20;Choose **Text** and we will use **Single line text** which is the default choice:

![Choose Text for the Content type](/files/wbn8JhD27bIVa80y23M7)

**Save** your new product metafield. Now we can use this custom theme.badge metafield with any of our products.&#x20;

### Product setup

{% hint style="success" %}
Now that our custom metafield has been defined, we can **easily** add a custom badge to any of our products.&#x20;
{% endhint %}

The next and final step is to edit any of your products in the Shopify Admin -> Products and update the new badge metafield. Scroll to the bottom of the product setup page:

![Product metafields are located at the bottom of the page](/files/rNwbsG6beFAz2NjTiiVL)

Update the Product badge metafield with the custom badge name:

![](/files/t8XwWeDoEGlHxZjaI3Fd)

Save your product and preview on any product grid view like Collection pages:

![](/files/D0vi6HBokb0o7Ohnwu6H)


---

# 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://story.groupthought.com/story-v2/collections/product-badges/custom-badges.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.
