Display rules for blocks
Every block can use every rule on this page, wherever the block is placed. Rules are listed in the same tabs as the Add rule picker.
Rules whose names start with Target only work when the block sits under a line item or a shipping option. They’re covered in rules for a specific line item or shipping option.
How values are matched
Section titled “How values are matched”A few patterns repeat across many rules. Knowing them saves a lot of guesswork.
Operators
- includes / does not include: for text, lists, and pickers.
- is equal to / is not equal to / is more than / is less than: for numbers. is more than and is less than are strict: use
49.99for “$50 or more”.
Contains or exact?
- Contains (part of the text is enough): titles, variant titles, product type, vendor, discount codes, shipping address lines, selected shipping method title.
- Exact (the whole value must match): tags, cart and line item attributes, city, country, province, zip codes, shipping method type.
Capital letters
- Ignored: titles, variant titles, product type, vendor, discount codes (in the Discount tab), shipping address lines, city, zip codes, shipping method titles.
- Must match: product tags, attribute keys and values, metafield values, Line item discount code or title.
Lists
- You can enter several values separated by commas in: every tag rule, Block IDs, No line item added by Checkout Buddy (specified blocks excepted), Delivery zip/postal codes, Shipping city, and Target line item product type. The rule passes if any value matches.
- Every other text rule takes one value. To match several, add one rule per value to the same group so they’re joined with OR.
Money is compared in the customer’s checkout currency without conversion. See currencies.
| Rule | What it checks | Notes |
|---|---|---|
| Cart products | Whether the cart contains any of the variants you pick | Matches by variant. Picking a product with only some variants selected only matches those variants. |
| Cart total | Shopify’s running checkout total | Includes shipping and tax once they’re known, so it can rise during checkout. |
| Cart total (unique products) | Total of the cart, counting each product once | Only the first line of each product is counted. |
| Cart total (excluding selected variants) | Total of every line except the variants you pick | Adds up line totals after line discounts. Never includes shipping or tax. |
| Cart total (excluding line item tags) | Total of every line whose product has none of the tags | Same as above. Tags are exact and case-sensitive. |
| Cart subtotal | Shopify’s checkout subtotal | Products only, no shipping or tax. |
| Cart subtotal (excluding selected variants) | Same as the “Cart total” version | Gives the same number as Cart total (excluding selected variants). |
| Cart subtotal (excluding line item tags) | Same as the “Cart total” version | Gives the same number as Cart total (excluding line item tags). |
| Total cart weight (kg) | Weight of every item times its quantity | Uses the weight set on each variant. Grams, ounces and pounds are converted to kilograms. |
| Total tax amount | Tax on the checkout | Doesn’t re-check by itself; see when rules are checked. |
| Number of line items | How many separate lines are in the cart | Two of the same shirt is one line. |
| Number of items | Total quantity across all lines | Two of the same shirt is two items. |
| Quantity of non-freebie line items | Lines with a price above zero | |
| Quantity of non-freebie items | Total quantity of lines priced above zero | |
| Quantity of non-freebie one-time items | Same, leaving out subscriptions | |
| Quantity of non-freebie non-bundle one-time items | Same, also leaving out bundles | |
| Cart collections | Whether any product in the cart is in the collections you pick | Only a product’s first 100 collections are checked. |
| Cart collections quantity | Total quantity of items in the picked collections | |
| Individual product quantity in collection | Whether any single line in the picked collections has the quantity | For example, “any line with more than 5”. |
| Cart non-collections quantity | Total quantity of items not in the picked collections | |
| Cart collections total value | Total value of items in the picked collections | |
| Quantity of variants | Total quantity of the variants you pick | The picked variants are added together. |
| Quantity of items with product tags | Total quantity of items whose product has any of the tags | Comma list. |
| Quantity of line items with product tags | Number of lines whose product has any of the tags | Comma list. |
| Selected freebies quantity | Quantity of the picked variants that are free | Free means the line total is zero. |
| Selected non-freebies quantity | Quantity of the picked variants that aren’t free | |
| Cart attribute key | Whether a cart attribute with this exact key exists | Case-sensitive. |
| Cart attribute value | Whether any cart attribute has this exact value | Case-sensitive. Any key. |
| Cart attribute key, value | Whether an attribute has this exact key and value | See attribute rules below. |
| Date (attribute) picked within “X” days | Whether a date stored in a cart attribute is between today and X days from now | Key is the attribute holding the date; Value is the number of days. Pairs with a date field. |
| Cart compare-at price greater than order total | Whether the cart’s full compare-at value is more than its subtotal | In practice: “something in the cart is on sale”. |
| Block IDs | Whether another Checkout Buddy block has been shown in this checkout | Comma list of block IDs. Needs tracking on; see the notes below. |
| Variants available for sale | Whether every variant you pick is in stock | |
| Cart variants available for sale | Whether every item in the cart is in stock |
Line item
Section titled “Line item”These rules look across the whole cart. “A line item” means any line.
| Rule | What it checks | Notes |
|---|---|---|
| Quantity of line items added by Checkout Buddy | How many lines were added or changed by a Checkout Buddy block | Needs tracking on. |
| Line item added by Checkout Buddy | At least one line was added by a Checkout Buddy block | Needs tracking on. |
| No line item added by Checkout Buddy | No line was added by a Checkout Buddy block | Needs tracking on. |
| No line item added by Checkout Buddy (specified blocks excepted) | No line was added by Checkout Buddy, or at least one was added by a block you list | Comma list of block IDs. |
| Line item price | Whether any line’s total matches | Uses the line total (price × quantity), not the unit price. |
| Selected line items price | Combined line totals of the variants you pick | |
| Line item bundle component title | A bundle in the cart has a component whose title contains the text | Bundles only. |
| Line item bundle component SKU | A bundle component’s SKU contains the text | Bundles only. |
| Line item title | Any product title in the cart contains the text | One value. |
| Line item subtitle (variant title) | Any variant title contains the text | For example Large. |
| Line item quantity | Whether any line’s quantity matches | |
| Line item product type | Any product type in the cart contains the text | One value. |
| Line item vendor | Any vendor in the cart contains the text | One value. |
| Line item tags | includes: a product in the cart has any of the tags. does not include: at least one product lacks all of them. | Comma list, case-sensitive. To mean “no product in the cart has this tag”, use Quantity of items with product tags is equal to 0. |
| All line items tags | Every product in the cart has all of the tags | Comma list. |
| Line item discount | A line has a discount whose code or title contains the text | Case-sensitive. |
| All line items discount | Every line has that discount | |
| Line item product metafield | A product in the cart has a metafield with this value | Namespace, Key, Value. For list metafields, passes if the list contains the value. |
| Line item variant metafield | A variant in the cart has a metafield with this value | Leave Value blank with is equal to to check the metafield is empty or missing. |
| Selected variants metafield | The variants you pick have a metafield with this value | Checks the picked variants whether or not they’re in the cart. Numbers are compared as numbers. |
| Line item attribute key | A line has a property with this key | |
| Line item attribute key, value | A line has a property with this key and value | is more than / is less than compare numbers. |
“Needs tracking on” means the rule reads the _buddy_data property that Checkout Buddy adds to lines. It stops working for lines added from an app block with Disable custom attributes on.
Customer
Section titled “Customer”| Rule | What it checks | Notes |
|---|---|---|
| Customer account exists | The customer is logged in or recognized | Guests fail this, even if they type an email that belongs to a customer. |
| Customer account does not exist | The customer is a guest | |
| Customer accepts marketing | A logged-in customer accepts email or SMS marketing | Always false for guests. |
| Customer does not accept marketing | The opposite | Always true for guests. |
| Buyer phone exists / does not exist | The customer entered a contact phone number | |
| Shipping phone exists / does not exist | The shipping address has a phone number | |
| Fixed customer metafield value (checkout_buddy.field) | The logged-in customer’s checkout_buddy.field metafield |
Equal and not equal compare exact text. More and less compare numbers. Also available for checkout_buddy.field_2, and for custom.field with equal and not equal only. |
| Fixed company metafield value | The B2B company’s checkout_buddy.field metafield |
Also (2) for checkout_buddy.field_2 and (custom.field) for custom.field. |
| Company metafield | A company metafield with any namespace and key | Not reliable at checkout. Use the Fixed company metafield value rules instead. |
Blocks can’t check customer tags, because Shopify doesn’t share them with checkout blocks. Functions can: see rules for functions. To use a customer tag with a block, copy the tag into the checkout_buddy.field customer metafield and use Fixed customer metafield value.
Discount
Section titled “Discount”| Rule | What it checks | Notes |
|---|---|---|
| Discount code | An applied code contains the text | Capitals ignored. SAVE matches SAVE10. One value. |
| Discount code exists / does not exist | At least one code is applied, or none | |
| Discount applied | Any discount is applied, automatic or code | |
| Discount not applied | No discount of any kind | |
| Cart discount allocations total | Total of order-level and shipping discounts | Doesn’t include product discounts. |
| Discount code count | Number of codes applied | |
| Specific discount code quantity | Number of applied codes that contain the text | One value. |
| Gift cards count | Number of gift cards applied | |
| Gift cards total value | Amount paid with gift cards |
Shipping
Section titled “Shipping”| Rule | What it checks | Notes |
|---|---|---|
| Shipping address 1 / Shipping address 2 | The address line contains the text | Capitals ignored. |
| Shipping country / Billing country | The country is the one you pick | One country per rule. Add more rules to the same group for more countries. |
| Shipping province / Billing province | The province or state is the one you pick | One per rule. |
| Delivery zip/postal code | The zip matches | Spaces and capitals ignored. End with * to match a prefix: M5V*. One value. |
| Delivery zip/postal codes | The zip matches any code in the list | Comma list. Type codes without spaces: M5V1A1, not M5V 1A1. * prefixes work. |
| Shipping city | The city matches any city in the list | Comma list. The whole city name must match; capitals ignored. |
| Shipping address company has a value | The shipping address has a company name | Also for billing, and for either one. |
| Selected shipping method title | The chosen shipping method’s name contains the text | Capitals ignored. |
| Target shipping method title | The shipping option this block sits under | See target rules. |
| Selected shipping method type | The chosen method is Shipping, Local, Pickup or Pickup Point |
Until the customer enters an address, address rules see empty values: includes fails and does not include passes.
Payment options
Section titled “Payment options”| Rule | What it checks |
|---|---|
| Selected payment option type | The kind of payment method the customer picked: Credit Card, Deferred, Local, Manual Payment, Offsite, Payment on Delivery, Redeemable (gift card, store credit), Wallet (PayPal, Apple Pay and similar), or Other. |
This checks the type of payment, not a specific provider’s name.
Date and time
Section titled “Date and time”These rules don’t show under the picker’s Date/time tab. Find them under All, or type date, day or time into the picker’s search box.
| Rule | What it checks | Notes |
|---|---|---|
| Date | Today’s date | Pick one or more dates. is equal to: today is one of them. is not equal to: none of them. is more than: after all of them. is less than: before all of them. |
| Day | Day of the week | Sunday to Saturday. |
| Time | Time of day, in 30-minute steps | Use is more than and is less than. is equal to only passes during that exact minute. |
To show a block between two dates, add Date is more than (the day before the start) and Date is less than (the day after the end) in separate groups so they’re joined with AND.
| Rule | What it checks | Notes |
|---|---|---|
| Cart includes component product | The cart contains one of this block’s own offered products | Only works for cross sells with manually chosen products and for checkbox product offers. |
| Cart excludes component product | The cart doesn’t contain any of them | Same limits. Useful for hiding an offer once it’s been added. |
| Cart includes line items of the same product | Two lines share the same product | For example, two sizes of the same shirt. |
| B2B customer exists / does not exist | The customer is buying for a B2B company | |
| A line item subscription exists / does not exist | Any line is a subscription | |
| Checkout note exists / does not exist | The customer wrote an order note | |
| Shipping address first name matches shipping address last name | First and last name are identical | Case-sensitive. Passes while both are still empty. |
Attribute rules
Section titled “Attribute rules”Cart attribute key, value has separate Key and Value fields. Both must match exactly, including capitals.
- is equal to with a blank Value passes when the attribute is missing or empty.
- is not equal to with a blank Value passes when the attribute has any value.
- is more than and is less than compare the values as text, not numbers, so
10counts as less than9. Use them only for values of the same length, such as dates written2026-09-23.
Checkout Buddy’s form fields and the Apply checkout attribute block write cart attributes, so these rules are how you make one block react to another.
