Add custom badges based on tags like "best seller" and "New" to Empire Template

Kimjik
Tourist
4 0 4

I need some help adding custom badges to product items in the Empire template. They would ideally be based on tags. I tried adding the tag:__label:Best Seller but had no results. Any help would be appreciated. 

Replies 5 (5)

Zworthkey
Shopify Partner
5581 642 1564

@Kimjik 

@By custom code you can add it. Easily, let me know if you want to know.

Thank you

KetanKumar
Shopify Partner
36835 3635 11966

@Kimjik 

Sorry you are facing this issue, it would be my pleasure to help you.

Welcome to the Shopify community!😊
Thanks for your good question.

Please share your site URL,
I will check out the issue and provide you a solution here.

If helpful then please Like and Accept Solution.
Want to modify or custom changes on store Hire me.
- Feel free to contact me on bamaniyaketan.sky@gmail.com regarding any help
Shopify Partner | Skype : bamaniya.sky
PSD to Shopify | Shopify Design Changes | Shopify Custom Theme Development and Desing | Custom Modifications In to Shopify Theme | SEO & Digital Marketing

JoesIdeas
Shopify Expert
2132 192 565

@Kimjik there are a couple steps to do this:

 

1. Add the tag to the customer

2. Upload the badge to the Assets folder

3. Add the theme code to show the badge where you want

 

An example for #3, say you want to add the badge to the product cards in collection pages, you would start with the Templates/collection.liquid file in your theme editor and read the code there to see the files included. Then read each file to find the snippet that shows your product cards (it's usually something like Snippets/product-card.liquid or product-grid.liquid).

 

Once you've identified the file where the code is, you can add an image tag with the badge, something like:

{% if product.tags contains "Best Seller" %}
<img src="{{ "badge-best-seller.png" | asset_img_url: "100px" }} class="collection-badge" />
{% endif %}

 

Then of course you'd style the CSS for the .collection-badge class to have it show how you'd like.

 

Do the edits on a duplicate theme so you don't affect your live theme - this guide will help with that + identifying elements to edit the CSS: https://speedboostr.com/how-to-safely-edit-your-shopify-theme.

 

If you get stuck or prefer to hire a professional Shopify developer, feel free to contact my team at speedboostr.com/contact.

 

Good luck.

• Creator of Order Automator (automate tagging, fulfillment, Amazon, notifications + more)
• Shopify developer for 10+ years, store owner for 7 years
• I also make guides like Shopify Automation Tips and How to Deal with Fraud / Chargebacks

fadi_yousif
Shopify Partner
342 43 60

I created a tutorial for this, not specifically tailored to the Ride theme, but you may find it helpfulhttps://youtu.be/0OjLBnyTyus?si=DxZODP2buUg0cUcc

KabirDev
Shopify Partner
243 58 63

Anyone looking for adding a badge or label in 2024, you can check this video out. I hope it helps.

If my answer helps, please give it a Like and Accept as Solution.
- You can join in our Facebook group for Shopify help.
- Contact me directly at shahriar@kabirdev.com