contain and does not contain

precision_efi
Tourist
6 0 0

hi im trying to make a flow similar to :

{% if customer.tags contains 'dealer' and product.tags does not contains 'customerstage'%}
  {% render 'product-accordions' %}   
{% endif%}
 
or something like
{% if customer.tags contains 'dealer' %}
      {% render 'product-accordions' %}
{% elsif product.tags contains 'customerstage'%}
      do nothing 
{% endif%}
 
i've tried to replace my do nothing in the second flow with a text flow but the product-accordions is always showing
 
any help will be appreciate thank you !
0 Likes
paul_nuschke
Shopify Staff
Shopify Staff
11 1 3

I don't think `does not contain` is valid liquid. Also, your second example is not the same logic as the first and it would always output if dealer is in the tags.

I think you want `unless` instead of does not contain, but you need to nest that condition instead the if statement. 

 

0 Likes