Hi! I want to add “new” badge like “sale” badge but I have no idea how to do that. Anyone can helps me? I use refresh theme
To add a “New” badge alongside the “Sale” badge in your Shopify store using the Refresh theme, you’ll typically need to edit the theme’s Liquid files. The general steps include:
-
Edit Product Template: Access the product template Liquid file (like product.liquid or a relevant snippet) in your theme.
-
Add Logic for ‘New’ Badge: Implement a condition to check if a product is new (based on criteria like the date added) and display a “New” badge. This might involve adding a new div or span with a class for styling.
-
Style the Badge: Use CSS to style the “New” badge, similar to how the “Sale” badge is styled.
If you’re not comfortable editing theme files, consider consulting with a Shopify expert.
I want to add “New” badge by tag
In that case, the process will be almost same. You can utilize the below liquid code to the correct liquid file like product-card.liquid
{% if product.tags contains 'New' %}
New
{% endif %}
Hi @dngmanblack ,
if you haven’t solved the “New” tag issue yet, I can recommend following one of my articles, where I explain how to add product labels on the product page as well as collection page (on product cards). I used Dawn theme when writing the guide, but the logic is the same.
Here’s the link: How to add a custom label to the main product image on a product page, collection page and a featured collection?
Hope this helps!
It’s worked! But it just appeareed on collection page. How to show it on every product that I gave them a tag. And can you show me how to custom this code to (padding, color. etc…)
I’m so sorry, but I have no experience about coding
You can make it appear in the product by adding code to price.liquid, find this line of code
{%- if show_badges -%}
Add this code under
{%- if product.tags contains 'New' -%}
New
{%- endif -%}
You can custom color, padding by adding inline CSS example like this
{%- if product.tags contains 'New' -%}
New
{%- endif -%}
Hi @martijn18
Please add this additional code after style="
margin-left: 8px;
So it will look like this



