Skip to content

Condition Operators

Conditions let you restrict when a shipping rule applies. A rule only fires when every condition on it passes. Conditions are split into three categories based on the field they test.

CategoryFieldsOperatorsValue type
Numericcart_total_price, cart_total_weight, cart_item_counteq, gte, lte, betweenNumber (single value, or two values for between)
Locationdestination_country, destination_provinceeq, in, not_inString or array of strings
Itemitem_vendor, item_product_title, item_skueq, contains, does_not_contain, starts_with, does_not_start_with, ends_with, does_not_end_with, in, not_inString or array of strings

Test the cart’s total price (cents), total weight (grams) or item count.

OperatorPasses when
eqCart value equals value.
gteCart value is greater than or equal to value.
lteCart value is less than or equal to value.
betweenCart value is between value and secondValue (both inclusive).

Test the destination country or province. Comparisons are case-insensitive.

OperatorPasses when
eqThe field matches value exactly.
inThe field matches any value in the array.
not_inThe field does not match any value in the array.

Test the vendor, product title or SKU of items in the cart. All comparisons are case-insensitive.

OperatorPasses when
eqAt least one item matches value exactly.
containsAt least one item contains value as a substring.
does_not_containNo item contains value as a substring.
starts_withAt least one item starts with value.
does_not_start_withNo item starts with value.
ends_withAt least one item ends with value.
does_not_end_withNo item ends with value.
inAt least one item matches any value in the array exactly.
not_inEvery item in the cart does not match any value in the array.

AND logic between conditions. All conditions on a rule must pass for the rule to fire. There is no OR logic at the condition level. If you need OR-style behaviour, create separate rules.

“Some” vs “every” for item conditions. Positive item operators (eq, contains, starts_with, ends_with, in) pass if at least one item in the cart satisfies the test. Negative operators (does_not_contain, does_not_start_with, does_not_end_with, not_in) pass only if no item in the cart satisfies the inverse test. This means does_not_contain on a cart with two items passes only when neither item contains the value.