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.
Tip:
Similar to the if tag, you can use elsif to add more conditions to an unless tag.
Tip: Similar to the <a href="/docs/api/liquid/tags/if"><code>if</code> tag</a>, you can use <code>elsif</code> to add more conditions to an <code>unless</code> 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 %}
Code
{% unless product.has_only_default_variant %}
// Variant selection functionality
{% endunless %}Data
{
"product": {
"has_only_default_variant": false
}
}Output
// Variant selection functionality
Output
// Variant selection functionalityWas this page helpful?