Conditional
To show or hide certain elements based on specific conditions, you can use conditional tags. This gives you more control over the frontend and can improve the user experience.
Last updated
Was this helpful?
Was this helpful?
li-unless = product.available == true{% unless product.available == true %}
<div class="product_tag">Sold out</div>
{% endunless %}li-case = product.typeli-when = 'T-Shirt'<div> //Element where li-case was attached
{% case product.type %}
{% when 'T-Shirt' %}
<div>T-Shirt</div>
{% when 'sweater' %}
<div>Sweater</div>
{% else %}
<div>Other products</div>
{% endcase %}
</div>