> For the complete documentation index, see [llms.txt](https://docs.webexp.dev/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.webexp.dev/drift-shopify-theme/drift-studio/metafields/badge.md).

# Custom Badge

Override the default sale badge with custom text per product.

By default, DRIFT shows an automatic "SAVE XX%" badge on products that have a `compare_at_price` set higher than the regular price. The custom badge metafield lets you override that with your own text — useful for "NEW", "LIMITED", "RESTOCK", "MEMBERS ONLY", whatever fits your brand.

## How DRIFT picks what badge to show

DRIFT checks in this priority order:

1. **`custom.badge` metafield** — if set, this overrides everything
2. **Product tags starting with `badge:`** — e.g., a tag like `badge:NEW` shows "NEW"
3. **Auto sale badge** — if `compare_at_price > price`, shows "SAVE XX%"
4. **Nothing** — no badge at all

So the metafield is the highest priority. If you set it on a product, that's what shows up.

**Sold-out products show no badges**, regardless of the priority above. A "SAVE 33%" pill on a product the customer can't actually buy is misleading; the "Sold Out" label on the product card / ATC button already communicates the state. So once `product.available` is false, all badges are suppressed.

## Setting up the metafield

1. Shopify admin → **Settings** → **Custom data** → **Products**
2. **Add definition**
3. Fill in:
   * **Name**: Custom Badge
   * **Namespace and key**: `custom.badge`
   * **Type**: Single line text
   * **Validations**: optional (you can cap character count if you want — anything over \~12 characters starts to look cramped)
4. Save

## Using it on a product

1. Open any product in admin
2. Scroll to the **Metafields** section at the bottom
3. Find **Custom Badge**
4. Type your text (e.g., `LIMITED`)
5. Save

Refresh the storefront. The product card and PDP now show your custom badge instead of the auto sale badge.

## Tips

* **Keep it short** — 8–12 characters max. "MEMBERS ONLY DROP" wraps and looks bad. "LIMITED" looks clean.
* **All caps reads best** — DRIFT's badge styling is designed for caps. Lowercase looks softer if that's your brand though.
* **Use sparingly** — if every product has a badge, none of them stand out. Use badges on the 5–10% of products that genuinely need attention.

## When to use the tag-based approach instead

If you have a big collection of products that need the same badge (e.g., a "NEW" drop where 30 products all need "NEW"), tags are faster to manage:

* Add `badge:NEW` as a tag to all 30 products
* DRIFT renders "NEW" on all of them
* When the drop is no longer new, just remove the tag in bulk

Tags use the same priority slot — if you have BOTH a metafield AND a tag, the metafield wins.

## Removing a badge

To remove a custom badge, just clear the metafield value (delete the text). The product reverts to whatever the next priority shows — either a tag-based badge, an auto sale badge, or nothing.

## Translations

The auto-calculated "SAVE X%" sale badge is translated via Shopify's locale system (`products.product.sale_badge`). DRIFT ships with translations for 30+ locales out of the box — Spanish (AHORRA X%), French (ÉCONOMISEZ X%), German (SPARE X%), Japanese (X%オフ), Korean, Chinese (CN/TW), and more. The active storefront language picks the right one automatically. No setup required.
