Show badge on products with specific tags

Show badge on products with specific tags

ewancastle
Shopify Partner
7 0 0

I'm currently running a specific promotion on certain products, and to highlight this, I'm adding a small badge on the bottom left of the product image on collection pages.

 

I'm currently running the following code:

 

{% if collection.title contains 'Multibuy' %}
  <span class="card__badge bottom left" style="background-color:#a7c5e5;">MULTIBUY</span>
{% endif %}

 

But I want to replicate this onto other collections that contain products that have the tag "Multibuy", I tried to use the following code but it doesn't work:

 

{% if product.tags contains 'Multibuy' %}
  <span class="card__badge bottom left" style="background-color:#a7c5e5;">MULTIBUY</span>
{% endif %}

 

Would appreciate any help with this as I'm unsure what else to do to get working.

Ewan Castle
Replies 6 (6)

KlaudiaW
Visitor
2 0 0

Not sure if you are already aware of it, but just throwing it out there as it's not very obvious.

Depending on the theme you are using, sometimes the variables in your product-card.liquid file may refer to the product in a different way than "product". So check for that specifically. I have seen different variations, in the two themes I'm using for my stores, it's "product_card_product" and "prod". So in my case, it would say {% if product_card_product.tags contains 'Multibuy' %}

KlaudiaW_0-1721160955749.png

 

 

Dan-From-Ryviu
Shopify Partner
11308 2214 2383

Hi @ewancastle 

What theme your store is using? 

- Found this helpful? Hit "Like" and "Accept as Solution"! - Feeling generous. Buy me coffee!
- Reton: Loyalty & Rewards - Earn points through tasks, redeem for discounts, and enjoy exclusive VIP rewards!
- Ryviu - Reviews & QA app: Collect product reviews, import reviews from AliExpress, Amazon, Etsy, Walmart, Shopee, Dhgate and CSV.
- Lookfy Gallery: Lookbook Image - Gain customers with photo gallery, video & shoppable image
Built for Shopify

Reelfy‑Shoppable Videos+Reels: Create shoppable videos to engage customers and drive more sales.
- En...
Sign up now.

ewancastle
Shopify Partner
7 0 0

Hi, I'm using Dawn theme.

 

I've placed this code in card-product.liquid

Ewan Castle
JasmeetVT14313
Shopify Partner
292 63 77

Hi @ewancastle 
Let me know if you need my assistance.

- VTN Customer Dashboard enhances your customer's dashboard with advanced features, profile management, and order tracking. Free trial available.
- Feel free to contact me at jasmeet.kaur@vtnetzwelt.com

JasmeetVT14313
Shopify Partner
292 63 77

Hi @ewancastle 
As this might need multiple file updates, is it possible for you to provide collaborator access? I can do it for you.
Any further queries or concerns you can DM me.

- VTN Customer Dashboard enhances your customer's dashboard with advanced features, profile management, and order tracking. Free trial available.
- Feel free to contact me at jasmeet.kaur@vtnetzwelt.com

Amanda_Fordeer
Shopify Partner
176 10 33

@ewancastle,

You can consider using third-party apps like Product Badges & Labels, which will assist you in creating product labels with specific collections and tags.

 
If you find my suggestion helpful, please give it a like or mark it as a solution!
And discover more approaches to:
Streamline invoicing process Boost sales with labels & badges Add social proofs & create FOMO
Or get valuable updates and private deals regarding Shopify here.