I’m currently using the dawn theme and have the 2 default badges which are SALE and SOLD OUT which change automatically.
Is there any way to create a new badge called ‘NEW’ so that products I choose have this badge displayed? And if so, can it be done by copy and pasting code into my custom .css file?
My store is saikocollective.com. This is the code that I currently have for my current badges. I’d like the ‘NEW’ badge to be the same colour, size and position as the SALE badge if possible.
/* Sale badge (product page) */
.product .badge[class*='sale']{
background: red !important;
color: #ffffff !important;
font-size: 14px !important;
}
/* Sold out badge (product page) */
.product .badge[class*='sold']{
background: #000000 !important;
color: #ffffff !important;
font-size: 14px !important;
}
@media (max-width: 749px){
/* Sale badge (product page) */
.product .badge[class*='sale']{
font-size: 13px !important;
}
/* Sold out badge (product page) */
.product .badge[class*='sold']{
font-size: 13px !important;
}
}
/* Sale badge top left */
.card__badge {
justify-self: flex-start!important;
align-self: auto !important;
grid-row-start: auto !important;
}
/* Sale badge square */
.badge{
border-radius: 0; top: 5; left: initial; right: 5; padding: 5px;
}
Hi thanks for this response! Will this change the new badge to be the same as my current badges? I made some edits to the positioning, size and colours so it’s slightly different to the default
Ankur, I use the TURBO Theme, and I was looking as well to add the NEW badge on the product page, I followed carefully your instructions but after I insert the code
{% if product.tags contains ‘new’ %}
{% include ‘product-badge-new’ %}
{% endif %}
anywhere in the product.liquid I receive the following error:
Liquid error (snippets/product line 190): include usage is not allowed in this context
I also watched your tutorial video on facebook to change the font color on my product tag but I have tried it several times and it I cannot get it to change. Are you able to assist me?