Discuss and resolve questions on Liquid, JavaScript, themes, sales channels, and site speed enhancements.
Hi, I want to have different colors on the "On Sale" badge from what I have on "Sold Out". I have found many working solutions on how to change them both at the same time with CSS but non where it's possible to give them different colors. I have added a screenshot where "På salg" equals "On Sale" and "Utsolgt" equals "Sold Out".
I currently have this on the bottom of the CSS file.
.badge {
background-color: red !important;
border-color: red !important;
color: white !important;
}
Does anyone know how?
Solved! Go to the solution
This is an accepted solution.
Hi @Mortskaa,
During the Black Friday sale season, you should consider finding an optimized solution for this problem. If you're unable to adjust the colors using code, it's advisable to utilize an app.
For instance, with Fordeer: Product Labels & Badges, you can easily create two campaigns (labels), one for items marked as "On Sale" and another for items marked as "Sold Out", and use:
1. Discount range to automatically display the label on "On Sale" products.
2. Inventory status (Out stock) for the "Sold Out" label.
Hey @Mortskaa
Welcome to Shopify Community! Can you share your Store URL so I can have a look on it? Also, if you have password enabled then please share the password as well. Your cooperation would be greatly appreciated.
Best Regards,
Moeed
Hey @Mortskaa
Can you remove the current code so that I can help you out?
Best Reagrds,
Moeed
Hello @Mortskaa , Add class "badge-on-sale" for "on sale" and "badge-sold-out" for "sold out" below added css for badge different colors.
.badge-on-sale {
background-color: #28a745 !important; /* Bright Green */
border-color: #28a745 !important;
color: white !important;
}
/* "Sold Out" Badge - Gray */
.badge-sold-out {
background-color: #808080 !important; /* Dark Gray */
border-color: #808080 !important;
color: white !important;
}
How can I get in touch with you?
We need a Shopify developer we can use for stuff like this, build widgets and so on going forward.
This is an accepted solution.
Hi @Mortskaa,
During the Black Friday sale season, you should consider finding an optimized solution for this problem. If you're unable to adjust the colors using code, it's advisable to utilize an app.
For instance, with Fordeer: Product Labels & Badges, you can easily create two campaigns (labels), one for items marked as "On Sale" and another for items marked as "Sold Out", and use:
1. Discount range to automatically display the label on "On Sale" products.
2. Inventory status (Out stock) for the "Sold Out" label.
June brought summer energy to our community. Members jumped in with solutions, clicked ...
By JasonH Jun 5, 2025Learn how to build powerful custom workflows in Shopify Flow with expert guidance from ...
By Jacqui May 7, 2025Did You Know? May is named after Maia, the Roman goddess of growth and flourishing! ...
By JasonH May 2, 2025