# Cart groups

Cart groups allow you to create a group based on conditions that you can set up through our easy-to-use rule builder interface.

For each group that you create, the following computed variables are available to you in the rule builder interface under the Rules section.

1. Total cart amount → Cart amount for the group, inclusive of discounts
2. Subtotal cart amount → Cart amount for the group, exclusive of discounts
3. Line count → Count of line items&#x20;
4. Quantity sum → Total sum of quantity of items matching cart group rules.
5. Unique product count → Unique products in the user's cart matching the group rules.&#x20;
6. Unique variant count → Unique variants in the user's cart matching the group rules.&#x20;

<figure><img src="https://2844543096-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FcVBfwy7Yj4tU8TsxkHEr%2Fuploads%2FjQStme99e60T34KSTKJN%2Fimage.png?alt=media&#x26;token=30e6f93a-642e-47e4-86ff-1b80b1911124" alt=""><figcaption></figcaption></figure>

***

## How to create a cart group?

You have the following variables available to you to define a cart group. You can combine these rules using AND / OR logic.&#x20;

<figure><img src="https://2844543096-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FcVBfwy7Yj4tU8TsxkHEr%2Fuploads%2Fwtraro7deI0gIzA6gG8m%2Fimage.png?alt=media&#x26;token=fcb13158-132c-4132-80dd-e241da3b0e10" alt=""><figcaption></figcaption></figure>

{% hint style="info" %}
Currently we do not support nesting conditions as this is still in early Beta. The AND / OR logic is set on the entire sub level and not on a per condition basis.&#x20;
{% endhint %}

#### Cart Rules

<table><thead><tr><th width="204">Rule Option</th><th>Description</th></tr></thead><tbody><tr><td>Cart Attribute</td><td>An attribute of the cart</td></tr><tr><td>Cart Market</td><td>The market associated with the cart</td></tr></tbody></table>

#### Customer Rules

<table><thead><tr><th width="201.33984375">Rule Option</th><th>Description</th></tr></thead><tbody><tr><td>Customer logged in</td><td>Whether the customer is authenticated</td></tr><tr><td>Customer is B2B</td><td>Whether the customer is a business customer (plus only)</td></tr><tr><td>Customer Spent</td><td>The total amount spent by the customer</td></tr><tr><td>Customer Orders Count</td><td>The number of orders placed by the customer</td></tr><tr><td>Customer ID</td><td>The IDs associated with the customer</td></tr><tr><td>Customer Tags</td><td>The tags associated with the customer</td></tr><tr><td>Customer Company</td><td>The company ID associated with the customer</td></tr></tbody></table>

#### Line Item Rules

<table><thead><tr><th width="197.25">Rule Option</th><th>Description</th></tr></thead><tbody><tr><td>Line Attribute</td><td>An attribute of the line item</td></tr><tr><td>Line Quantity</td><td>The quantity of the line item</td></tr><tr><td>Line Subtotal</td><td>The total cost of the cart line item (price x quantity)</td></tr><tr><td>Variant ID</td><td>The variant IDs associated with the line item</td></tr><tr><td>Product ID</td><td>Shopify Product ID of the item in the user's cart</td></tr><tr><td>Product Tag</td><td>Product tag of the item as set up in the admin UI.</td></tr><tr><td>Product Collection</td><td>The collections associated with the line item</td></tr><tr><td>Selling Plan Allocation</td><td>Whether the line item has a selling plan</td></tr></tbody></table>
