> For the complete documentation index, see [llms.txt](https://help.dollarlabs.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://help.dollarlabs.io/dollarlabs-ultimate-discounts/unified-discount-engine-v2/cart-groups.md).

# 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="/files/TRDNlpGlC4lU4QWP8m14" 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="/files/0Chd4F0b4mGMaobRiAdZ" 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>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://help.dollarlabs.io/dollarlabs-ultimate-discounts/unified-discount-engine-v2/cart-groups.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
