Variables available in the Rule Builder
The variables in the Dollar Discounts rule engine are essential for creating robust discounts by combining them using simple AND & OR conditions. Below is an explanation of the key types and conditions, followed by a table of rule options.
Key to Conditions
Equal (EQ): The value must be exactly equal.
Not Equal (NQ): The value must not be equal.
Starts With (SW): The value must start with the specified text.
Ends With (EW): The value must end with the specified text.
Greater Than (GT): The value must be greater than the specified amount.
Lesser Than (LT): The value must be less than the specified amount.
Divisible By (DB): The value must be divisible by the specified amount.
Matching ONE of (CO): The list must contain at least one of the specified values.
Matching ALL of (CA): The list must contain all the specified values.
Not matching (NC): The list must not contain any of the specified values.
Key to Types
Currency: Refers to money-related values, typically involving price or cost. Always defined in store currency.
Number: Refers to numerical values, such as quantities or counts.
String: Refers to text values.
Array: Refers to a collection of values, such as lists of IDs, tags, or locations.
Boolean: Refers to true/false values, indicating binary states such as authenticated or not authenticated.
Rule Options
Cart Rules
Cart Attribute
String
EQ, NQ, SW, EW
An attribute of the cart
Cart subtotal
Currency
EQ, LT, GT
The subtotal value of the cart
Cart Quantity
Number
EQ, LT, GT, DB
The quantity of items in the cart
Cart Market
Array
CO, NC
The market associated with the cart
Cart Has Product
Array
CO, NC, CA
Whether the cart has specific products
Cart Has Variant
Array
CO, NC, CA
Whether the cart has specific variants
Customer Rules
Customer logged in
Boolean
EQ
Whether the customer is authenticated
Customer is B2B
Boolean
EQ
Whether the customer is a business
Customer Spent
Currency
EQ, LT, GT
The total amount spent by the customer
Orders Count
Number
EQ, LT, GT, DB
The number of orders placed by the customer
Customer ID
Array
CO, NC
The IDs associated with the customer
Customer Tags
Array
CO, CA, NC
The tags associated with the customer
Customer Company
Array
CO, NC
The company ID associated with the customer
Line Item Rules
Line Attribute
String
EQ, NQ, SW, EW
An attribute of the line item
Line Quantity
Number
EQ, LT, GT, DB
The quantity of the line item
Line Subtotal
Currency
EQ, LT, GT
The total cost of the cart line item (price x quantity)
Variant ID
Array
CO, NC
The variant IDs associated with the line item
Product ID
Array
CO, NC
Shopify Product ID of the item in the user's cart
Product Tag
Array
CO, CA, NC
Product tag of the item as set up in the admin UI.
Product Collection
Array
CO, CA, NC
The collections associated with the line item
Selling Plan Allocation
Boolean
EQ
Whether the line item has a selling plan
Last updated