Adding a tag-based badge (e.g., “NEW”) to product cards in Shopify’s Dawn theme. The core approach is to render a badge in the collection grid when a product tag is present, then style/position it with CSS.
Working implementation (Dawn 5+):
In snippets/card.product (near the existing Sold out/Sale badge block), add a condition such as: {% if card_product.tags contains ‘TAG’ %} Label {% endif %}. Some versions use product_card_product instead of card_product.
Style in base.css or component-card.css (e.g., .card__badge–yourtag) and ensure the stylesheet is loaded. Position with absolute, top/left to match built-in badges.
Version notes:
Confirmed working in Dawn 5.0 and 6.0.2. Some users on v6 saw “text-only” due to missing/incorrect CSS link or class mismatch.
Common issues and fixes:
Badge shows only on first product: verify all products have the exact (case-sensitive) tag.
Badge appears below image on mobile: use absolute positioning in CSS.
“translation missing”: don’t use | t for plain strings; avoid invalid color variables.
Multiple badges (Sale/Sold Out + custom): Dawn typically shows only one; no built-in multi-badge support.
Adding badges on the product page (PDP) requires custom code; current solutions target the collection grid only.
Resources shared: YouTube tutorials and a metafield-based community guide. Thread remains open with version/theme-specific nuances.
Summarized with AI on December 21.
AI used: gpt-5.
I have been attempting to add a badge based on tags. I had previously done this in the Debut theme, but have begun upgrading to Dawn for Shopify 2.0 and cant seem to get the code to work correctly on Dawn theme.
This was to add a badge based on a tag given to a product, in my case “NEW” would be added to the product card for products that are tagged with NEW.
Within Dawn Theme Code editor I have tried.
In > product-card.liquid
Within the div :
{% for tag in product.tags %}
{%- if current_tags contains 'NEW' -%}
NEW!
{% endif %}
{% endfor %}
I did notice within the product-card.liquid there was no link to the component-card.css stylesheet - im not sure if this was required, but I also added along side the current stylesheet code, the component-card.css stylesheet link at the top.
To further develop the “NEW” badge - I would of liked to of done it with a timer and publishing date, so the product would contain new for 2 - 3 weeks after publishing but disappear after that. That would reduce maintain of removing badges on now, old stock. Though I haven’t gotten to that point just yet, I cant even get the current tag to appear in the browser yet!
I’m having similar issues. The badge is working and showing up but only on the first product on the page with “More Options” but I have about 10 other products on the page where the badge doesn’t show up. Can anyone help? Thank you!
It works perfectly fine. But there only on the desktop. When I switch to mobile, there is no badge, but a “new” underneath the picture. You can have a look at my online shop:
You should replace ‘framed’ with the tag that you wish to pick up in the logic.
You should also replace ‘Framed’ (on the second line between the double curly braces) with the actual text that you want to appear in the badge.
Once done, save the file. Your code should look similar to this
{%- if card_product.available == false -%}
{{ 'products.product.sold_out' | t }}
{%- elsif card_product.compare_at_price > card_product.price and card_product.available -%}
{{ 'products.product.on_sale' | t }}
{%- elsif card_product.tags contains 'framed' -%}
{{ 'Framed' }}
{%- endif -%}
Now open the base.css file within the theme code
Add the following code to the bottom of the file. Be sure to make sure that the class is the same as in the liquid code you entered above (in this case it is .card__badge–framed). This code is based on what you originally wrote
Big thanks to @VUMODigital ! Finally got it working again after upgrading to Dawn 5.0!! The older version is not working with it some how. I added your last code to component-card.css instead of base.css and it works fine as well.
see @VUMODigital solution on badges for Dawn themes using the most recent version (v.5 at time of this post released on April 19th 2022)
You may not receive an option to update your theme if you have used custom code in your theme. You will need to “Add New Theme” and start from scratch to work on the latest version of DAWN
Hi, have not tried 6.0 but do ensure that the style sheet is linked and labelled corectly in the header of the page and the css style is within that file that you have linked . Let us know if that helps!
Hi !! I tried your proposed solution and had to make a few changes because it wasn’t properly working for me. Now, I have a few problems I don’t know if you can help me with:
I did the same as you wrote here, now its showing in my products the badge, but do you know how I can change the back colour? I add one photo, for you see how it is showing, but I can’t see very well.