Conditions
Conditions decide who and what a Playwright Checkout Rules rule applies to. Combine customer, cart, product and destination conditions in one rule, and choose whether all or any of them must match.
All or any
Most templates have three places for conditions: Eligible Customers, Eligible Carts in Checkout and, in shipping and payment rules, Eligible Line Items in Cart. Each can be “All” (no condition), one condition, or a Multi-Select of up to three.
- The rule’s first setting, All or any criteria, decides whether all of its conditions must match or any one of them. Places left at “All” aren’t counted, and a rule with no conditions applies to every cart.
- Multi-Select - Meets all criteria matches when all of its conditions do; Multi-Select - Meets any criteria when any does. Use them to mix: “tagged VIP” and (“in Canada” or “in the US”).
- In shipping and payment rules, the item condition is checked against the cart’s items, and Line item qualify condition decides whether any item or every item must match.
- In discount rules, the item condition picks which items get the discount, and doesn’t decide whether the rule applies.
Which rules can use each condition
Shopify gives each part of checkout different information, so a few conditions only work in some kinds of rule. Playwright checks every rule before you publish and leaves out any rule that uses a condition Shopify can’t check there, with the reason. The kinds of rule are:
- Discount rules
- Line item rules other than quantity limits: discounts, discount code rules, bundles, buy X get Y, tiers and free gifts. Published as “Playwright: discount rules”.
- Quantity limits
- The Quantity Limit template. Published as “Playwright: quantity limits”.
- Shipping discounts
- Shipping Discount and Cap Shipping Rates. Published as “Playwright: shipping discounts”.
- Shipping option rules
- Shipping rules that hide, rename or reorder rates. Published as “Playwright: shipping rules”.
- Payment rules
- Every payment rule. Published as “Playwright: payment rules”.
“Yes” works as set up, “Limited” works with the note below it, “No” isn’t published, and “–” isn’t offered in that kind of rule.
Customer conditions
| Condition | Discount rules | Quantity limits | Shipping discounts | Shipping option rules | Payment rules |
|---|---|---|---|---|---|
| Customer Email | Yes | Yes | Yes | Yes | Yes |
| Customer Tags | Yes | Yes | Yes | Yes | Yes |
| Customer Order Count | Yes | Yes | Yes | Yes | Yes |
| Customer Total Spend | Yes | Yes | Yes | Yes | Yes |
| Customer Accepts Marketing | No | No | No | No | No |
Cart conditions
| Condition | Discount rules | Quantity limits | Shipping discounts | Shipping option rules | Payment rules |
|---|---|---|---|---|---|
| Cart/Item/Discount subtotal | Yes | Yes | Yes | Yes | Yes |
| Cart/Item/Line quantity | Yes | Yes | Yes | Yes | Yes |
| Cart Has Items | Yes | Yes | Yes | Yes | Yes |
| Cart Total Weight | No | No | No | No | No |
| Cart Has Discount Code | Limited | No | Limited | No | No |
| Cart Has No Discount Code | Yes | No | Yes | No | No |
| Discounted Cart Subtotal (applied by discount code) | No | No | No | No | No |
| Language | Yes | Yes | No | Yes | Yes |
| Discounted Cart Subtotal (after this rule's discount) | Yes | Yes | – | – | – |
| Exclude Discount Codes | Limited | No | – | – | – |
Destination conditions
| Condition | Discount rules | Quantity limits | Shipping discounts | Shipping option rules | Payment rules |
|---|---|---|---|---|---|
| Country/Province Qualifier | Yes | Yes | Yes | Yes | Yes |
| Country Code Qualifier | Yes | Yes | Yes | Yes | Yes |
| Postal or ZIP code | Yes | Yes | Yes | Yes | Yes |
| PO Box Qualifier | No | No | Yes | Yes | Yes |
| Full Address Qualifier | No | No | Yes | Yes | Yes |
| Compare to billing address | No | No | No | No | No |
Product conditions
| Condition | Discount rules | Quantity limits | Shipping discounts | Shipping option rules | Payment rules |
|---|---|---|---|---|---|
| Product ID | Yes | Yes | Yes | Yes | Yes |
| Product Type | Yes | Yes | Yes | Yes | Yes |
| Product Vendor | Yes | Yes | No | Yes | Yes |
| Product Tag | Yes | Yes | Yes | Yes | Yes |
| Variant SKU | Yes | Yes | No | No | Yes |
| Variant ID | Yes | Yes | Yes | Yes | Yes |
| Has Properties | No | No | No | No | No |
| Item Price | Yes | Yes | Yes | Yes | Yes |
| Gift Card Selector | Yes | Yes | No | No | Yes |
| Sale Item Selector | Yes | Yes | No | No | No |
| Discounted Item Selector (discount by scripts) | Yes | Yes | No | No | No |
| Subscription Item Selector | Yes | Yes | No | No | Yes |
Shipping rate selectors
| Condition | Discount rules | Quantity limits | Shipping discounts | Shipping option rules | Payment rules |
|---|---|---|---|---|---|
| All | – | – | Yes | Yes | – |
| Rate Name | – | – | Yes | Yes | – |
| Rate Code | – | – | Yes | Yes | – |
| Rate Source | – | – | No | No | – |
| Rate Price | – | – | Yes | Yes | – |
| Rate Discounted | – | – | Yes | Yes | – |
Payment option selectors
| Condition | Discount rules | Quantity limits | Shipping discounts | Shipping option rules | Payment rules |
|---|---|---|---|---|---|
| All | – | – | – | – | Yes |
| Payment Option Name | – | – | – | – | Yes |
Customer conditions
Who is checking out. Customer conditions need Shopify to know who the customer is, for example because they’re signed in to their account.
- Customer Email
- The customer’s email address does (or doesn’t) match, contain, start with or end with what you enter. Use “End with one of” and
@yourcompany.comfor staff. The customer’s side is compared as entered, so capital letters can matter. - Works in: every kind of rule.
- Customer Tags
- The customer has (or doesn’t have) one of the tags you list. On Shopify Functions, use Match one of and list whole tags.
- Works in: every kind of rule.
- “Contain one of”, “Start with one of” and “End with one of” aren’t available on Shopify Functions: tags match whole tags only.
- Customer Order Count
- How many orders the customer has placed, compared with a number. “Less than 1” means a first order.
- Works in: every kind of rule.
- Customer Total Spend
- How much the customer has spent on past orders, in dollars, compared with an amount.
- Works in: every kind of rule.
- Customer Accepts Marketing
- Whether the customer accepts marketing. Not available on Shopify Functions: tag those customers and use Customer Tags instead.
- Not available on Shopify Functions.
- Shopify Functions can’t see whether a customer accepts marketing. Tag those customers and use a customer tag condition instead.
Cart conditions
What’s in the cart, what it costs and which discount code was entered.
- Cart/Item/Discount subtotal
- Compares an amount, in dollars: the cart’s current subtotal, the subtotal of the items the rule selects, or how much the cart or the selected items have been discounted. In line item rules, “current” means after the discounts of earlier rules.
- Works in: every kind of rule.
- Cart/Item/Line quantity
- Compares a quantity: the cart’s total quantity, the total of the selected items, or the quantity on any (or every) line of the selected items.
- Works in: every kind of rule.
- Cart Has Items
- The cart has a quantity or subtotal of items matching a product condition you set inside it, like “at least 2 items tagged
gift-set”. - Works in: every kind of rule.
- Cart Total Weight
- The cart’s total weight. Not available on Shopify Functions.
- Not available on Shopify Functions.
- Cart weight isn’t available to Shopify Functions.
- Cart Has Discount Code
- A discount code the customer entered does (or doesn’t) match, contain, start with or end with what you list. Exact codes in a line item rule are created in Shopify for you. See Discount code rules.
- Works in: discount rules, shipping discounts.
- Not in quantity limits, shipping option rules, payment rules: Only discount rules and shipping discounts can see which discount code was entered.
- Note: Only the first entered discount code is checked.
- Cart Has No Discount Code
- The customer hasn’t entered a discount code.
- Works in: discount rules, shipping discounts.
- Not in quantity limits, shipping option rules, payment rules: Only discount rules and shipping discounts can see which discount code was entered.
- Discounted Cart Subtotal (applied by discount code)
- The subtotal after discount codes. Not available on Shopify Functions, which can’t see a code’s value.
- Not available on Shopify Functions.
- Shopify Functions only see the discount code itself, not its type or value.
- Language
- The language of the customer’s checkout does (or doesn’t) match, start with or end with what you list, like
froren-CA. - Works in: discount rules, quantity limits, shipping option rules, payment rules.
- Not in shipping discounts: Language conditions aren’t available to shipping price rules on Shopify Functions.
- Discounted Cart Subtotal (after this rule's discount)
- Line item rules only: the rule’s discount is kept only if the cart’s subtotal after the rule meets the condition. Use it so a discount never takes a cart below an amount.
- Works in: discount rules, quantity limits.
- Exclude Discount Codes
- Line item rules only: decides what happens when a customer enters a code and this rule applies. Apply discount code only skips the rule; Reject discount code and apply script rejects the code with your message and gives the rule’s discount. With Reject all codes, except the following, the codes you list are kept and the rule’s discount applies too; Accept all codes, except the following rejects only the codes you list. See Stop discount stacking.
- Works in: discount rules.
- Not in quantity limits: Only discount rules and shipping discounts can see which discount code was entered.
- Note: Codes are only rejected when Shopify allows it (codes from automatic-discount conflicts are kept).
Destination conditions
Where the order ships. They match once the customer enters a shipping address at checkout.
- Country/Province Qualifier
- The shipping address is (or isn’t) in the countries and provinces or states you list, by two-letter code:
CAwithON, QC. - Works in: every kind of rule.
- Country Code Qualifier
- The shipping address’s country is (or isn’t) one of the two-letter codes you list, like
USorGB. - Works in: every kind of rule.
- Postal or ZIP code
- The shipping postal code does (or doesn’t) match, contain, start with or end with what you list. “Start with one of” and
90covers 90000 to 90999. - Works in: every kind of rule.
- PO Box Qualifier
- The shipping address is (or isn’t) a PO box. Shipping and payment rules only: discount rules can’t see street addresses.
- Works in: shipping discounts, shipping option rules, payment rules.
- Not in discount rules, quantity limits: Street addresses aren’t available to discount rules. Use this condition in shipping or payment rules.
- Full Address Qualifier
- The shipping address matches one of the addresses you list, by street lines, city, province, country and postal code, partly or exactly. Shipping and payment rules only. The phone number can’t be checked.
- Works in: shipping discounts, shipping option rules, payment rules.
- Not in discount rules, quantity limits: Street addresses aren’t available to discount rules. Use this condition in shipping or payment rules.
- Compare to billing address
- Whether the billing and shipping addresses match. Not available on Shopify Functions.
- Not available on Shopify Functions.
- Shopify Functions can’t compare billing and shipping addresses here.
Product conditions
Which items a rule acts on (“Eligible Line Items in Cart”), and, in shipping and payment rules, which items in the cart make the rule apply.
- Product ID
- The product’s ID is (or isn’t) one you list. Find it in the product’s address in your Shopify admin.
- Works in: every kind of rule.
- Product Type
- The product type is (or isn’t) one you list.
- Works in: every kind of rule.
- Product Vendor
- The product’s vendor is (or isn’t) one you list.
- Works in: discount rules, quantity limits, shipping option rules, payment rules.
- Not in shipping discounts: Vendor conditions aren’t available to shipping price rules on Shopify Functions.
- Product Tag
- The product has (or doesn’t have) one of the tags you list. On Shopify Functions, use Match one of and list whole tags.
- Works in: every kind of rule.
- “Contain one of”, “Start with one of” and “End with one of” aren’t available on Shopify Functions: tags match whole tags only.
- Variant SKU
- The variant’s SKU does (or doesn’t) match, contain, start with or end with what you list.
- Works in: discount rules, quantity limits, payment rules.
- Not in shipping discounts, shipping option rules: SKU conditions aren’t available to shipping rules on Shopify Functions. Select items by product or variant instead.
- Variant ID
- The variant’s ID is (or isn’t) one you list.
- Works in: every kind of rule.
- Has Properties
- The item has custom properties you list. Not available on Shopify Functions.
- Not available on Shopify Functions.
- Line item properties aren’t available to Shopify Functions.
- Item Price
- The item’s price is at least, or at most, an amount in dollars.
- Works in: every kind of rule.
- Gift Card Selector
- The item is (or isn’t) a gift card.
- Works in: discount rules, quantity limits, payment rules.
- Not in shipping discounts, shipping option rules: Gift card conditions aren’t available to shipping rules on Shopify Functions.
- Sale Item Selector
- The item is (or isn’t) on sale: it has a compare-at price above its price.
- Works in: discount rules, quantity limits.
- Not in shipping discounts, shipping option rules: Sale-price conditions aren’t available to shipping rules on Shopify Functions.
- Not in payment rules: Sale-price conditions aren’t available to payment rules on Shopify Functions.
- Discounted Item Selector (discount by scripts)
- An earlier Playwright line item rule did (or didn’t) discount the item.
- Works in: discount rules, quantity limits.
- Not in shipping discounts, shipping option rules, payment rules: Shipping and payment rules can’t see the discounts your line item rules gave.
- Subscription Item Selector
- The item is (or isn’t) bought on a subscription.
- Works in: discount rules, quantity limits, payment rules.
- Not in shipping discounts, shipping option rules: Subscription conditions aren’t available to shipping rules on Shopify Functions.
Shipping rate selectors
Which shipping rates a shipping rule changes.
- All
- Every shipping rate.
- Works in: shipping discounts, shipping option rules.
- Rate Name
- Rates whose name does (or doesn’t) match, contain, start with or end with what you enter. Names are compared without regard to capital letters.
- Works in: shipping discounts, shipping option rules.
- Rate Code
- Rates whose code (the service code a carrier or shipping app gives the rate) does or doesn’t match what you enter.
- Works in: shipping discounts, shipping option rules.
- Rate Source
- Rates from a given source, such as Shopify or a carrier. Not available on Shopify Functions: select rates by name or code instead.
- Not available on Shopify Functions.
- The shipping rate source (Shopify or carrier) isn’t available to Shopify Functions. Select rates by name or code instead.
- Rate Price
- Rates above or below a price, in dollars.
- Works in: shipping discounts, shipping option rules.
- Rate Discounted
- Rates an earlier shipping rule did or didn’t discount.
- Works in: shipping discounts, shipping option rules.
Payment option selectors
Which payment options a payment rule changes.
- All
- Every payment option.
- Works in: payment rules.
- Payment Option Name
- Options whose name does (or doesn’t) match, contain, start with or end with what you enter, as customers see it at checkout. Names are compared without regard to capital letters.
- Works in: payment rules.
Tips
- Tags must match whole tags. List every tag you mean, like
VIPandVIP-gold, rather than “contains VIP”. - Amounts are in dollars (your store’s currency), except the shipping price cap, which is in cents.
- Country and province codes are two letters:
US,CA,ON,NY. - Lists like tags or IDs take room in your published rules. Each area has a size limit.