Shopify If Tag does not contain
Asked Answered
B

1

7

What's the opposite of contains in Shopify Liquid Smarty tags?

I basically want to hide products from Search page that has the tag hideme

Example code : {% if product.tags contains 'hideme' %}. In this I want to use does not contain instead of contains

Bartholomeus answered 20/3, 2019 at 22:17 Comment(0)
T
11

The opposite of {% if %} is {% unless %} so your code would change to:

{% unless product.tags contains 'hideme' %}
     <blinky> stuff mmm good for cookie monster </blinky>
{% endunless %}
Theisen answered 21/3, 2019 at 2:21 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.