Operators
Is
The is
operator is used to perform tests on variables. It is followed by a specific test (such as null
, empty
, defined
, etc.) and returns true
or false
depending on whether the variable meets the test criteria.
Example using is to check if the variable order.tracking_numbers_formatted (Tracking Number(s)) has a defined value or not:
In this example, the is
operator is used to check two conditions:
is defined
: Checks if the variable order.tracking_numbers_formatted
is defined.
is not empty
: Checks if the variable is not empty.
If both conditions are true, the message “Your tracking number is (Customer’s Tracking Number(s)).” will be displayed. Otherwise, the message “Your order does not have a tracking number yet.” will be shown.