I want to add more pages to my products like Best Seller, New Added, 50%OFF, and more how Can I add this anyone helping me, please
Thank You
Hey @jafakav Could you please share the store URL? This will allow me to inspect it and provide you with a more tailored solution.
Sorry, Kaushik, could you please provide the code and Iâll add it. Thank you!
No Problem @jafakav allowed me some time to provide you with the code
-
Add Tags to Products
Best Seller
New Added
50% OFF -
Edit the Theme Code
- Go to your Online Store
- Click on âThemesâ
- Select âEdit codeâ
- Open your snippets/card-product.liquid file
- Add code below of this code https://prnt.sc/WrkwZ3ugzq7s
{% assign badge_tags = 'Badge-BestSeller,Badge-NewAdded,Badge-50Off,Badge-Clearance' | split: ',' %}
{% for tag in product.tags %}
{% if badge_tags contains tag %}
{% case tag %}
{% when 'Badge-BestSeller' %}
Best Seller
{% when 'Badge-NewAdded' %}
New Added
{% when 'Badge-50Off' %}
50% OFF
{% when 'Badge-Clearance' %}
Clearance
{% endcase %}
{% endif %}
{% endfor %}
- Add CSS Styles for Each Badge
Open your CSS file and add the code below
.badge {
position: absolute;
top: 10px;
left: 10px;
padding: 5px 12px;
color: #000;
font-size: 12px;
font-weight: 700;
border-radius: 3px;
z-index: 10;
}
.badge-bestseller {
background-color: #ff9800;
}
.badge-newadded {
background-color: #4caf50;
}
.badge-50off {
background-color: #f44336;
}
.badge-clearance {
background-color: #9c27b0;
}
.badge-bestseller::before {
content: '\2605'; /* Star icon */
margin-right: 5px;
}
.badge-50off::before {
content: '\0025'; /* Percentage symbol */
margin-right: 3px;
}
If you need further assistance, please let me know. If you found my help useful, consider liking this message and marking it as the solution.
Best regards
Kaushik
Working Kaushik, thank you. I need to add white text color. How can I do that? Can you help me?
replace this CSS @jafakav
.badge {
position: absolute;
top: 10px;
left: 10px;
padding: 5px 12px;
color: #fff; /* change this */
font-size: 12px;
font-weight: 700;
border-radius: 3px;
z-index: 10;
}
Working Thank you for your assistance. I greatly appreciate your help.
Thank you
Welcome, @jafakav If you found my help useful, consider liking this message and marking it as the solution.
Hello @Kaushik_7
I would like to know if you can also help me put some on mine too?
website: www.diversusoficial.com
password: diversusoficial
I want to add 2 badges:
- âEXCLUSIVE LOOKAL BEACH CLUBâ for when i drop a specific collection exclusive for one place
- âNEW INâ for when i drop new products
I want it to look like this example:
Thanks in advance.
Hello @Kaushik_7 ,
Would be possible to help me?
Hey, @HELDERWRLD Please use the same above code, change the name else all are the same.
Hi! Im wondering if you can help me.
Im using the Craft theme and after i updated the version of it my badges stopped working.
Im using on the card product liquid:
And on the main product
{% if product.tags contains â3 för 2â %}
It looks like it used to on the pages you see all the products but if you press one, on the product page its in the corner of the website, not in the corner of the image.
Before it was inside the picture:
My css is like this:
.custom_label {
position: absolute;
top: 10px;
left: 0px;
z-index: 10;
background-color: #b49df1;
padding: 8px 20px 8px 20px;
font-size: 1.3rem;
color: white;
}
I dont know why it stopped working after the update, any ideas?
Thank you!



