All things Shopify and commerce
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.
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' %}
Hi @ewancastle
What theme your store is using?
- Helpful? Like and Accept solution! or Buy me coffee
- Ryviu - Reviews & QA app: Collect product reviews, import reviews from AliExpress, Amazon, Etsy, Walmart, Shopee, Dhgate and CSV.
- Lookfy Gallery: Lookbook Image: Easy and fast to create Photo Gallery, Lookbook, Shop The Look.
- Ryviu: Aliexpress Reviews - AliExpress Reviews Importer, one-click import aliexpress reviews, export reviews to CSV file.
- Reelfy‑Shoppable Videos+Reels: Create shoppable videos to engage customers and drive more sales.
- Enjoy 1 month of Shopify for $1. Sign up now.
Hi, I'm using Dawn theme.
I've placed this code in card-product.liquid
Hi @ewancastle
Let me know if you need my assistance.
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.
You can consider using third-party apps like Product Badges & Labels, which will assist you in creating product labels with specific collections and tags.
Starting a B2B store is a big undertaking that requires careful planning and execution. W...
By JasonH Sep 23, 2024By investing 30 minutes of your time, you can unlock the potential for increased sales,...
By Jacqui Sep 11, 2024We appreciate the diverse ways you participate in and engage with the Shopify Communi...
By JasonH Sep 9, 2024