Custom product badges
Updated yesterday
Custom product badges display a label β like "New" or "Limited edition" β on a product, using a metaobject and a matching product metafield.
Configure a badge
Badges are set up in your Shopify admin, not the theme editor.
In Shopify admin, go to Settings > Custom data > Metaobjects > Add definition and create a metaobject with the fields you want a badge to show, such as a label and color.
Go to Settings > Custom data > Metafield definitions > Products > Add definition. Create a product metafield with the namespace and key
trafik-plus.product_badge, referencing the metaobject you just created, with "One entry" selected.Open a product's admin page. The metafield now appears there β set it to the metaobject entry for the badge you want on that product.
The metafield's namespace and key must match exactly: trafik-plus.product_badge. A mismatch means the badge won't appear.
Reuse the same metaobject entry across multiple products instead of creating a new one for each badge.
Schedule a badge
Add two "Date and time" fields to the metaobject β start_date and end_date β both set to "One value" with "Required field" unchecked, to control when a badge appears automatically.
A badge with both dates set displays only within that window.
A badge with only a start date displays from that moment until you remove the metaobject from the product.
A badge with only an end date displays from the moment you save it until the end date passes.