博客新文——认识三个智能体:Z1、Reach 和 Ana
注册
注册
Z1
创意设计与建站
图片与视频邮件弹窗与表单AI 建站落地页即将推出
Mogiu达人与联盟营销
全部产品
店铺搭建达人营销付费广告全部服务
价格
联系我们

主题设置参考

/

4 min read

Product badges and the badge: tag

Automatic Sold out / Sale / Best seller badges, custom chips from badge:<Label> product tags, and badge styles that color them by label.

Product cards show two kinds of badges: automatic ones driven by product state, and custom ones you add with a product tag. Colors for all of them are configured once in Theme settings, so merchandisers never touch a color picker.

Automatic badges

The theme adds these on its own — one per product, in priority order:

BadgeShows whenColors
Sold outNo variant is availableStandard badge colors
SaleCompare-at price is higher than the priceSale badge colors
Best sellerThe product is tagged bestseller (also matches best-seller / best seller)Standard badge colors

Custom badges with the badge: tag

Tag a product badge:<Label> and the card grows a chip with that label:

  • badge:New → a New chip
  • badge:Limited edition → a Limited edition chip
  • Several badge: tags on one product render several chips, stacked under the automatic badge.
1

Tag the product

In Shopify admin, open Products and select one or more products — bulk editing works: select many, then Add tags.

2

Use the badge: form

Add a tag like badge:New — everything after badge: becomes the chip text, exactly as typed.

3

Done

The chip appears on every product card surface — collection grids, featured collections, recommendations, search — and on the product page above the title.

The label keeps your capitalization ("badge:Back in stock" renders as "Back in stock"). Removing the tag removes the chip — nothing to clean up in the theme editor.

Coloring badges: badge styles

Colors live in Theme settings → Badges, matched by label so tags stay clean:

  • Standard badge and Sale badge colors cover the automatic badges and any custom chip that doesn't match a style below.
  • Badge style 1 and Badge style 2 each define a comma-separated Labels list plus background and text colors. A badge: chip whose label appears in a style's list (case-insensitive) uses that style's colors.

Example setup:

LabelsBackgroundText
Badge style 1New, Just inBlackWhite
Badge style 2Limited, Last chanceBlushCharcoal

Now badge:New and badge:Just in render black, badge:Limited renders blush, and badge:Holiday (no match) falls back to the standard badge colors.

Because matching is by label, a rebrand is two color pickers in Theme settings — you never edit tags on products. Multiple labels per style also handle multilingual tag sets: put "New, Nouveau, 新品" in one list and they all share a look.

Unlimited styles with a metaobject

Two styles cover most stores, but there's no cap: create a metaobject and every entry becomes another badge style.

1

Create the definition

In Shopify admin, go to Settings → Custom data → Metaobjects → Add definition. Name it anything, but set the type to badge_style, and add three fields with these exact keys: labels (single line text), background (color), text (color).

2

Add entries

Under Content → Metaobjects → badge_style, add one entry per style — e.g. labels Holiday, Gift, a green background, white text.

3

Tag products

badge:Holiday now renders with that entry's colors everywhere badges appear. Metaobject entries match first, then Badge styles 1–2, then the standard colors.

Placement

Theme settings → Product cards → Badge position places card badges in the image corner (stacked vertically) or below the image next to the title (wrapping row). See Product card settings for the rest of the card options.

On the product page, the same badges render above the product title. They're part of the Title & price block — toggle them with its Show badges setting.

上一篇

Product card settings

下一篇

Appearance settings: corner radii