> ## Documentation Index
> Fetch the complete documentation index at: https://codebeans-cb-checkout-rules.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Condition sets

> Every condition you can use in a custom rule, grouped by condition set.

Shopify limits how much checkout data one rule can read. To stay within that limit, conditions are split into four **condition sets**. You choose one set when you create a custom rule, and you can use any condition in that set.

![The four condition sets, what each is best for, how many conditions it has and which plan it needs.](https://mintcdn.com/codebeans-cb-checkout-rules/9lVKcptiAqYAtTXj/images/condition-sets.svg?fit=max\&auto=format\&n=9lVKcptiAqYAtTXj\&q=85\&s=a828eba0042939f6a30a3b4f714ac03b)

| Set | Best for | Conditions | Plans |
| - | - | - | - |
| [Condition Set 1](#condition-set-1) | Cart, products, collections, customer tags and the shipping address | 22 | Starter and above |
| [Condition Set 2](#condition-set-2) | Customer metafields, cart attributes, company, phone and the selected delivery option | 12 | Starter and above |
| [Condition Set 3](#condition-set-3) | B2B buyers and customer order history | 14 | Growth and above |
| [Condition Set 4](#condition-set-4) | Product variants, subscriptions, delivery type and billing address | 10 | Enterprise |

> [!NOTE]
>
> Custom rules start on the Starter plan. See [Plans](https://codebeans-cb-checkout-rules.mintlify.site/help/plans.md).

> [!TIP]
>
> Need conditions from two different sets? Create two custom rules, one for each set.

Address conditions check the **shipping address**, unless the group is called **Billing Address**. For what each operator does, see [Operators](https://codebeans-cb-checkout-rules.mintlify.site/custom-rules/operators.md).

## Condition Set 1

> [accordion] Customer
>
> | Condition | Operators |
> | - | - |
> | Customer tags | Has any of these values, Does not have any of these values |
> | Email | Has any / Does not have any of these values (partial match), Has any / Does not have any of these values (exact match) |
>
> A rule can check up to 100 different customer tags.

> [accordion] Order details
>
> | Condition | Operators |
> | - | - |
> | Total amount | Is greater than or equal to, Is less than or equal to, Equals, Does not equal, Is between |
> | Subtotal amount | Is greater than or equal to, Is less than or equal to, Equals, Does not equal, Is between |
> | Discount amount | Is greater than or equal to, Is less than or equal to, Equals, Is between |
> | Discount percentage | Is greater than or equal to, Is less than or equal to, Equals, Is between |
> | Total quantity | Is greater than or equal to, Is less than or equal to, Equals, Does not equal |
> | Total weight | Is greater than or equal to, Is less than or equal to, Equals, Is between |
>
> Discount amount and discount percentage include product, order and shipping discounts.

> [accordion] Shipping address
>
> | Condition | Operators |
> | - | - |
> | Country / region | Is one of, Is not one of |
> | Province / state code | Equals, Does not equal, Is one of, Is not one of |
> | City / area | Equals, Does not equal, Contains, Does not contain, Matches regex |
> | ZIP / postal code | Equals, Does not equal, Contains, Does not contain, Matches regex, Is one of |
> | Address line 1 + 2 | Contains, Does not contain, Matches regex |
> | Address line 1 | Equals, Does not equal, Contains, Does not contain, Matches regex |
> | Address line 2 | Equals, Does not equal, Contains, Does not contain, Matches regex, Is empty, Is not empty |
> | PO Box address | Is a PO Box address, Is not a PO Box address |
> | Address line 1 + 2 length | Is greater than or equal to, Is less than or equal to, Equals, Is between |
> | Address line 1 length | Is greater than or equal to, Is less than or equal to, Equals, Is between |
> | Address line 2 length | Is greater than or equal to, Is less than or equal to, Equals, Is between |
>
> **Province / state code** uses the short code, for example `CA` for California or `MH` for Maharashtra.

> [accordion] Cart has any items
>
> | Condition | Operators |
> | - | - |
> | Collection | Is one of, Is not one of |
> | Product | Is one of, Is not one of |
>
> Click the value box to search for and select products or collections.

> [accordion] Cart details
>
> | Condition | Operators |
> | - | - |
> | Quantity in collection | Is greater than or equal to, Is less than or equal to, Equals |
>
> Counts the total quantity of items in the cart that belong to the collections you select.

> [!WARNING]
>
> **Collection** conditions use the products that are in the collection when you save the rule. If you add products to the collection later, open the rule and click **Save** again so the rule includes them.

## Condition Set 2

> [accordion] Customer
>
> | Condition | Operators |
> | - | - |
> | Customer metafield | Has any of these values, Has none of these values, Is empty, Is not empty |
>
> Enter the metafield's **namespace** and **key**, for example `custom` and `loyalty_tier`. A rule can check one customer metafield, so every customer metafield condition in the rule uses the same namespace and key.

> [accordion] Order details
>
> | Condition | Operators |
> | - | - |
> | Total amount | Is greater than or equal to, Is less than or equal to, Is between |
> | Subtotal amount | Is greater than or equal to, Is less than or equal to, Is between |
> | Total quantity | Is greater than or equal to, Is less than or equal to, Is between |
> | Total weight | Is greater than or equal to, Is less than or equal to, Is between |
>
> For **Total weight**, choose the unit: kg, g, lb or oz.

> [accordion] Shipping address
>
> | Condition | Operators |
> | - | - |
> | Country / region | Has any of these values, Does not have any of these values |
> | Company | Has any / Does not have any of these values (partial or exact match), Is empty, Is not empty, Matches regex, Does not match regex |
> | Phone | Is empty, Is not empty, Starts with, Does not start with |
> | PO Box address | Is a PO Box address, Is not a PO Box address |

> [accordion] Cart details
>
> | Condition | Operators |
> | - | - |
> | Cart attribute | Has any / Does not have any of these values (partial or exact match), Is empty, Is not empty, Matches checkout field, Does not match checkout field |
> | Quantity in collection | Is greater than or equal to, Is less than or equal to, Is between |
>
> For **Cart attribute**, enter the attribute's key. With **Matches checkout field**, the attribute is compared with another checkout field instead of a value you type. You can compare it with: Email, Shipping phone, Shipping city, Shipping zip / postal code, Shipping address line 1, Shipping country / region, Shipping company, Billing phone or Billing country / region.

> [accordion] Shipping
>
> | Condition | Operators |
> | - | - |
> | Selected delivery option | Has any / Does not have any of these values (partial or exact match) |
>
> Compares the name of the delivery option the customer chose, for example `Express`.

## Condition Set 3

> [accordion] Customer
>
> | Condition | Operators |
> | - | - |
> | Customer total previous spent | Is greater than or equal to, Is less than or equal to, Is between |
> | Customer's total previous order count | Is greater than or equal to, Is less than or equal to, Is between |
>
> These conditions use the customer's history in your store. Guest customers count as 0.

> [accordion] B2B details
>
> | Condition | Operators |
> | - | - |
> | Customer is B2B | Is true |
> | Customer is not B2B | Is true |
> | Purchasing company name | Has any / Does not have any of these values (partial or exact match), Is empty, Is not empty, Matches regex, Does not match regex |
> | Purchasing company metafield | Has any of these values, Has none of these values, Is empty, Is not empty |
> | Purchasing company location | Has any / Does not have any of these values (partial or exact match), Is empty, Is not empty |
> | Purchasing company location metafield | Has any of these values, Has none of these values, Is empty, Is not empty |
>
> A customer is B2B when they are buying for a company in Shopify B2B.

> [accordion] Order details
>
> | Condition | Operators |
> | - | - |
> | Total amount | Is greater than or equal to, Is less than or equal to, Is between |
> | Subtotal amount | Is greater than or equal to, Is less than or equal to, Is between |

> [accordion] Shipping address
>
> | Condition | Operators |
> | - | - |
> | Country / region | Has any of these values, Does not have any of these values |
> | First name | Has any / Does not have any of these values (partial or exact match), Is empty, Is not empty |
> | Last name | Has any / Does not have any of these values (partial or exact match), Is empty, Is not empty |
> | Full name | Has any / Does not have any of these values (partial or exact match), Is empty, Is not empty |

## Condition Set 4

> [accordion] Cart has any items
>
> | Condition | Operators |
> | - | - |
> | Product | Is one of, Is not one of |
> | Product variant | Is one of, Is not one of, Has any of these values, Does not have any of these values |
> | Product with selling plan | Is one of, Is not one of |
> | Any product in cart has a selling plan | Is true |
> | No product in cart has a selling plan | Is true |
>
> A selling plan is how a product is sold on subscription or pre-order. Click the value box to choose from your store's selling plans.

> [accordion] Shipping address
>
> | Condition | Operators |
> | - | - |
> | Country / region | Has any of these values, Does not have any of these values |

> [accordion] Shipping
>
> | Condition | Operators |
> | - | - |
> | Selected delivery option type | Has any of these values, Does not have any of these values |
>
> Types: Local Pickup, Local Delivery, Shipping to a Pickup Point, Retail, Shipping, None.

> [accordion] Address comparison
>
> | Condition | Operators |
> | - | - |
> | Shipping and billing countries do not match | Is true |
>
> True only when both countries are known and they are different.

> [accordion] Billing address
>
> | Condition | Operators |
> | - | - |
> | Country / region | Has any of these values, Does not have any of these values |
> | Phone | Is empty, Is not empty, Starts with, Does not start with |


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.