Shopify themes, liquid, logos, and UX
I'm trying to add 2 conditions on an %if tag on product-template.liquid code. Screenshot attached of what the code currently looks like.
It's working for the first condition (vendor) but it's not filtering out the second condition (product tags). Please let me know what I'm doing wrong!
Hello @Emma1903,
Greetings from the Store Watchers Support Team! Happy to help you today.
Product.tags value type is array not string that's why it is not working. You have to use code like :
{% if product.vendor == 'Jamie Joseph' %}
{% unless product.tags contains 'RINGS' %}
<p>ADD PARAGRAPH YOU WANT TO ADD HERE</p>
{% endunless %}
{% endif %}
Note :
Let me know if require further assistance!
Regards,
Store Watchers Support Team
Thank you so much! This is very helpful and makes sense. Where I'm stuck, is that I don't want to exclude RINGS. I want to exclude all other product types (example: PENDANTS, NECKLACES, EARRINGS). How would I use this code in order to target product vendor JAMIE JOSEPH and RINGS?
Hello @Emma1903,
Please use below updated code to do it :
{% if product.vendor == 'JAMIE JOSEPH' and product.tags contains 'RINGS' %}
<p>ADD PARAGRAPH YOU WANT TO ADD HERE</p>
{% endif %}
As 2024 wraps up, the dropshipping landscape is already shifting towards 2025's trends....
By JasonH Nov 27, 2024Hey Community! It’s time to share some appreciation and celebrate what we have accomplis...
By JasonH Nov 14, 2024In today’s interview, we sat down with @BSS-Commerce to discuss practical strategies f...
By JasonH Nov 13, 2024