Boolean/Bool (true/false)
A bool is a truth value and can only be true or false.
Boolean values are mostly produced in combination with comparison operators. For example, when comparing one value with another, the result is either true or false.
Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
Reference for WEBSALE control structures: boolean values, if and switch branches and foreach loops used to drive conditional template output.
true | truth value true |
false | truth value false |
"true" | not a truth value (wrong syntax: string) |
{{ if $quantity == 1 }}
Displayed when the value of the variable $quantity equals 1.
{{ /if }}
String: {{= bool(" ")}} // true
String: {{= bool("")}} // false
Integer: {{= bool(1) }} // true
Integer: {{= bool(0) }} // false
Float: {{= bool(1.0) }} // true
Float: {{= bool(0.0) }} // false
Was this page helpful?
