> ## Knowledge Base Index
> Fetch the complete knowledge base index at: https://regiostech.crisp.help/sitemap.xml
> Use this file to discover available pages before exploring further.
> Pure-Markdown content can be obtained by appending a '.md' suffix to the content URLs listed in the sitemap (without the trailing slash).

# Maximum Quantity Input

![Screenshot of the "Quantity" input on a percentage discount](https://storage.crisp.chat/users/helpdesk/website/d13e90de659a8800/image_1beb4a3.png)

In many cases, you'll need control over the exact number of items a discount should apply to. You can do this by setting the "Quantity" of a discount to one of the following:
* Zero
* A positive number
* A negative number

You can find the "Quantity" input in the "Advanced options" when creating an "Apply discount" step in our [advanced logic builder](/en/article/about-the-advanced-logic-builder-1xxaj2u/).

By default, discounts will apply to all eligible items (in other words, all items that meet the requirements of a given logic chain. More info [here](/en/article/applies-to-options-17o5wxb/)).

# Quantity options
## Apply to all eligible items
![Screenshot of the "Quantity" input with a value of 0](https://storage.crisp.chat/users/helpdesk/website/d13e90de659a8800/image_gernwe.png)

If the quantity is `0` or unset, the discount will apply to all eligible items. For example, if you have a "Check if" step that includes only products in a specific collection, and an "Apply discount" with a quantity of 0, then all products in that collection will receive that discount.

**This is the default.**

## Apply to a specific number of items
![Screenshot of the "Quantity" input with a value of 2](https://storage.crisp.chat/users/helpdesk/website/d13e90de659a8800/image_i3aohy.png)

If the quantity is set to a positive number, the discount will apply to only that number of eligible items. For example, if you have a "Buy 3, Get 2" discount, you can set the "Quantity" to `2` to make sure only a maximum of 2 items get the discount.

## Apply to all except the last N items
![Screenshot of the "Quantity" input with a value of -2](https://storage.crisp.chat/users/helpdesk/website/d13e90de659a8800/image_13sv1xd.png)

If the quantity is set to a negative number, our app will:
1. Compute the absolute value of that number (for example, if you entered `-2`, this would be `2`)
2. Subtract that number from the total quantity of eligible items
3. Only apply the discount to that number of items

For example, if 10 items are eligible for your discount, but the quantity is `-4`, then only 6 items will receive the discount.

# Your Feedback Matters
Your review helps keep this small business running. Please [leave one](https://apps.shopify.com/regios-automatic-discounts#modal-show=ReviewListingModal) on the Shopify App Store.