Skip to main content

unless

Renders an expression unless a specific condition is true.


Tip

Similar to the if tag, you can use elsif to add more conditions to an unless tag.


Syntax

{% unless condition %}
expression
{% endunless %}
condition

The condition to evaluate.

expression

The expression to render unless the condition is met.

{% unless product.has_only_default_variant %}
// Variant selection functionality
{% endunless %}

Output

// Variant selection functionality
Was this page helpful?