How can I create a flow with customer tags and product tags?

precision_efi
Tourist
9 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 !
Replies 2 (2)

paul_n
Shopify Staff
946 128 225

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. 

 

Paul_N | Flow Product Manager @ Shopify
- Finding Flow useful? Leave us a review
- Need Flow help? Check out our help docs.
- Building for Flow? Check out Flow's dev docs.

DutchDelight
Excursionist
21 0 4

According to https://shopify.github.io/liquid/tags/control-flow/ you can use 'unless' instead of an if-then statement.