Visibility conditions reference
In short
Checkout Ninja has 31 visibility conditions covering the cart, products, customer, address, shipping, payment, discounts, cart attributes and metafields. Each block's conditions are combined with OR: the block shows when any one condition matches. With Enable conditional block visibility turned off, the block always shows.
✓ Applies to
- Advanced and Deluxe plans
- Block visibility, under Block Visibility on each block
- Checkout rules use the same condition list
✕ Doesn't apply to
- Single block types inside a block. Conditions apply to the whole block
How matching works
| Setting | Behaviour |
|---|---|
| Enable conditional block visibility off | The block always shows. Saved conditions are ignored. |
| On, with no conditions | The block always shows. |
| On, with one or more conditions | The block shows when any condition matches (OR). |
| A condition with no condition type selected | Ignored. |
| A condition with an operator left on ”-“ | Never matches. |
Conditions are checked live in checkout. When the cart, address, shipping method or payment method changes, the block appears or disappears without a page reload.
Conditions apply to the whole block, including every block type inside it. To show different content to different buyers, make one block per audience and place each Block ID in its own Custom Block app block.
Operator sets
Most conditions use one of these operator sets. The condition tables below say which.
Number operators
| Operator | Matches when the value is |
|---|---|
| Equal | exactly the number |
| Not Equal | anything but the number |
| Greater Than | above the number |
| Greater Than or Equal | the number or above |
| Less Than | below the number |
| Less Than or Equal | the number or below |
A blank or non-numeric value never matches.
Text operators
| Operator | Matches when the text |
|---|---|
| Equal | is exactly your value |
| Not Equal | is anything but your value |
| Contains | includes your value |
| Not Contains | doesn’t include your value |
| In list | is one of a comma-separated list. Don’t put spaces after the commas: A,B,C |
| Not In list | is none of a comma-separated list |
| Length is greater than | has at least this many characters (the check includes equal) |
| Length is less than | has at most this many characters (the check includes equal) |
| Empty | is blank or missing. Leave the value empty |
| Match regex | matches a regular expression. Blank text never matches |
| Not Match regex | doesn’t match a regular expression. Blank text never matches |
All text operators are case-sensitive.
List operators
| Operator | Matches when |
|---|---|
| In this list | the checkout value is one of the options you select |
| Not in this list | the checkout value is not one of the options you select |
Conditions that check lists of items
Some conditions look at a list: applied discount codes, discount titles or selected payment options. These match when at least one item in the list passes the operator. With no items, they never match, even with a negative operator such as Not Equal.
Cart and product conditions
| Condition | What it checks | Value | Operators |
|---|---|---|---|
| Cart Total | The cart subtotal | Amount (number) | Number, under When cart total is |
| Product in cart | Any selected product is in the cart | Product (one or more) | None |
| Product not in cart | None of the selected products is in the cart | Product (one or more) | None |
| Variant in cart | Any selected variant is in the cart | Product Variant | None |
| Variant not in cart | None of the selected variants is in the cart | Product Variant | None |
| Product quantity in cart | Total quantity of all variants of all selected products | Product (one or more), Quantity | Number |
| Product type in cart | A cart product has exactly this product type | Product Type (text) | None |
| Product type not in cart | No cart product has this product type | Product Type (text) | None |
| No of Products (Include quantity for each product) | Total number of items in the cart, counting quantities | Value (number) | Number |
| Vendor Name in cart | A cart product is from exactly this vendor | Value (text) | None |
| Vendor Name not in cart | No cart product is from this vendor | Value (text) | None |
Product type and vendor values are matched exactly and are case-sensitive.
Customer and address conditions
| Condition | What it checks | Value | Operators |
|---|---|---|---|
| Customer billing has phone | The customer’s phone has at least 8 characters | None | None |
| Customer billing has email | The customer’s email has at least 2 characters | None | None |
| First Name | First name on the delivery address | Value (text) | Text |
| Last Name | Last name on the delivery address | Value (text) | Text |
| Shipping Address 1 | Address line 1 of the delivery address | Value (text) | Text |
| Shipping Address 2 | Address line 2 of the delivery address | Value (text) | Text |
| Shipping Country | Country of the delivery address | Value (one or more countries) | Is, Is Not |
| Shipping State / Province | Province code of the delivery address | State / Province Codes (type a code, press Enter) | Is, Is Not |
Address conditions have nothing to compare until the buyer has entered that part of the address. With no country yet, Is doesn’t match and Is Not does.
Delivery and payment conditions
| Condition | What it checks | Value | Operators |
|---|---|---|---|
| Shipping Delivery method title Selected by Customer | Title of the selected shipping method | Title (text) | Text |
| When delivery type is shop pickup | A store pickup option is offered for the order | None | None |
| Payment Method Type | Type of the selected payment method | Payment Method type: Credit Card, Deferred, Local, Manual Payment, Offsite, Other, Payment On Delivery, Redeemable, Wallet, Custom Onsite | List |
| Payment Method Handle | Handle of the selected payment method | Value (text) | Text |
For Payment Method Handle, the in-app help says to contact support for the handle of a payment method.
Discount and gift card conditions
| Condition | What it checks | Value | Operators |
|---|---|---|---|
| Discount Code (order and shipping discounts only) | Codes entered for order- or shipping-level discounts | Value (text) | Text |
| Discount Title (order and shipping discounts only) | Titles of order- or shipping-level discounts, including automatic ones | Value (text) | Text |
| Product Discount Code | Codes entered for discounts on individual cart items | Value (text) | Text |
| Product Discount Title | Titles of discounts on individual cart items, including automatic ones | Value (text) | Text |
| Gift card is applied | At least one gift card is applied | None | None |
| No of gift cards applied | Number of gift cards applied | Number | Number |
Cart attribute and metafield conditions
| Condition | What it checks | Value | Operators |
|---|---|---|---|
| Cart attribute key and value | The value of one cart attribute | Key, Value | is equal to, is not equal to, contains, does not contain |
| Cart metafield key and value | The value of one cart metafield, for example one saved by an input block | Namespace (default custom), Key, Value | is equal to, is not equal to, contains, does not contain, is empty, is not empty |
A cart attribute that isn’t set counts as blank text. So is not equal to and does not contain match when the attribute is missing.
Use Cart metafield key and value to react to buyer input, for example to show a block when a checkbox block saved to a metafield is ticked. See save a field to an order metafield.
Frequently asked
Do all conditions have to match? +
No. For block visibility, the block shows when any one of its conditions matches. There's no setting to require all of them.
What happens to a condition with no operator selected? +
It never matches. Pick an operator for every condition that has one.
Are text comparisons case-sensitive? +
Yes. Equal, Contains, In list and the regex operators compare text exactly as written, including capitals.
What does Cart Total include? +
For block visibility, Cart Total is compared with the cart subtotal that Shopify reports to checkout apps. It doesn't include shipping.