Is it possible to add a badge under "Add to Cart" on select products based on a Label Tag?

Solved
Highlighted
Tourist
7 0 0

Hello!

I was wondering if it was possible to add custom badges to select products based on a tag? I already have trust badges in place (PayPal, Visa, etc) but I'd like to add another level of badges to only a few products that are Eco Friendly.

 

Is this possible and if so, what is the best way to set this up so I can easily turn it on or off for select future products? In a perfect world it would be awesome to just add a tag that would make it show up - but I'm definitely open to other suggestions!

Any input would be greatly appreciated, thank you so much!

0 Likes
Highlighted
Shopify Partner
1445 195 523

This is an accepted solution.

Yup, 100% possible. You would have to go into your product-template.liquid section (if this doesnt exist it's probably just product.liquid in the templates folder) and find where your add to cart button is, then use a conditional statement to check the product's tags and if it has the tag, display the badge. So say you tagged the product "ecofriendly" it would be something like:

 

<button class="add-to-cart">Add To Cart</button>
{% if product.tags contains "ecofriendly" %}
<img src="/path-to-your-badge.jpg">
{% endif %}
If my solution helped you, please like and accept as solution!
If you'd like to make any edits to your store, please send me a personal message and we can discuss what you'd like to accomplish :D
Highlighted
Tourist
7 0 0

Thank you so much Ninthony - this was EXACTLY what I've been needing!

0 Likes
Highlighted
Shopify Partner
222 17 84

Hey @Kitti,

I noticed that you wanted to apply custom badges like Eco-friendly to select products.

We'll our app (Modemagic) allows you to add product stickers/badges on your catalog within seconds. And we have an extensive collection of customized stickers based on different occasions (Sale & Discounts, Pre-Order, Trust Badges, and much more). You can also create custom badges based on what copy you prefer, and also upload custom badges and apply them on your products. 

Screenshot 2020-08-24 at 8.14.37 PM.pngScreenshot 2020-08-26 at 9.43.56 PM.pngScreenshot 2020-08-26 at 9.43.39 PM.pngScreenshot 2020-08-18 at 10.48.51 PM.png

No complex edits, no back & forth with designers. Update your store within seconds! And it's free!

Don’t find a sticker that meets your need, reach out to us on chat for a custom design. We also create stickers in various languages. Check out this app on Shopify here.

Hope this helps. Let me know if you'll need more assistance, I'd be happy to help.
Fayaz

ModeMagic
Featured on Shopify Staff Picks
0 Likes