If product.tag contains - but want to leave out a certain product vendor

I’m looking to adjust an “if product.tag contains” code but can’t quite figure out what I need to add. I have the following code input currently onto all products tagged “pendant”:

{% if product.tags contains ‘PENDANTS’ %}

Price is for pendant only. Chain sold separately. Shop our chain selection here.

{% endif %}

But I want a certain product vendor to be left out of this. For example - if the product vendor is “x” I don’t want it to fall under this main rule.

Any idea on what I have to add here? I’m looking at my product-template.liquid section. Thanks so much!

1 Like

@Emma1903 you can create a nested condition:

{% unless product.vendor == "XYZ"}
 {% if product.tags contains 'PENDANTS' %}
 

**Price is for pendant only.** Chain sold separately. 
 Shop our chain selection here.

 {% endif %}
{% endunless %}
2 Likes

@Emma1903

Hi,

The solution was give by @Finer already.

The only thing I would add here is he missed % for the unless condition.

You may also add more vendors with “or” condition as below.

{% unless product.vendor == "ABC Company" or product.vendor == "XYZ Company" %}
  {% if product.tags contains 'PENDANTS' %}
    

**Price is for pendant only.** Chain sold separately. 
    Shop our chain selection here.

  {% endif %}
{% endunless %}

Hope it helps.

Thanks.

2 Likes

Worked perfectly - thank you!