> For the complete documentation index, see [llms.txt](https://responsive-media.gitbook.io/advanced-free-shipping/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://responsive-media.gitbook.io/advanced-free-shipping/conditions-products/collection-item-quantity.md).

# Collection Item Quantity

## Overview

The **Collection Item Quantity** condition applies discounts based on how many items from specific collections are in the cart. Perfect for "buy X from collection" promotions.

## How It Works

This condition has two parts:

1. **Select collections** - Which collections to count items from
2. **Set threshold** - How many items are required

**Example**: Select "T-Shirts" collection, threshold 3

* Cart with 3 t-shirts → ✓ Qualifies
* Cart with 2 t-shirts + 1 jacket → ✗ Doesn't qualify (only counts t-shirts)

## Available Operators

All numeric operators:

* **Is greater than**
* **Is less than**
* **Is equal to**
* **Is at least** - Most common
* **Is at most**

## Common Use Cases

{% tabs %}
{% tab title="Buy 3 Get Free Shipping" %}
**Free shipping when buying 3+ from collection**

* Collections: "T-Shirts"
* Quantity **is at least** 3
* Discount: Free shipping

**Message**: "Buy 3 or more t-shirts, get free shipping!"
{% endtab %}

{% tab title="Multi-Collection Bundle" %}
**Buy 5+ from seasonal collections**

* Collections: "Summer", "Spring"
* Quantity **is at least** 5
* Discount: Free shipping

Counts items from BOTH collections combined.
{% endtab %}

{% tab title="Bulk Discount" %}
**Free shipping on 10+ accessories**

* Collections: "Accessories"
* Quantity **is at least** 10
* Discount: Free shipping
  {% endtab %}
  {% endtabs %}

## Quantity Calculation

Items are counted from ALL selected collections combined:

**Example**: Select "Summer" and "Spring" collections, threshold 5

| Cart Contents             | Quantity | Qualifies?                  |
| ------------------------- | -------- | --------------------------- |
| 3 summer + 2 spring items | 5        | ✓ Yes                       |
| 5 summer items            | 5        | ✓ Yes                       |
| 3 summer items            | 3        | ✗ No                        |
| 3 summer + 1 winter item  | 3        | ✗ No (winter doesn't count) |

## Best Practices

{% hint style="info" %}
Use this for "Buy X items from collection" promotions where the specific products don't matter, just the quantity.
{% endhint %}

{% hint style="info" %}
Combine with cart value to prevent customers from adding low-value items just to hit the quantity threshold.
{% endhint %}

## Related Conditions

* [**Collection Item Cost**](/advanced-free-shipping/conditions-products/collection-item-cost.md): Base discount on collection value instead of quantity
* [**Collection in Cart**](/advanced-free-shipping/conditions-products/collection-in-cart.md): Simple presence check without quantity
* [**Cart Quantity**](/advanced-free-shipping/conditions-cart-and-order/cart-quantity.md): Total cart quantity (all products)


---

# 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, and the optional `goal` query parameter:

```
GET https://responsive-media.gitbook.io/advanced-free-shipping/conditions-products/collection-item-quantity.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
