> ## Documentation Index
> Fetch the complete documentation index at: https://docs.atomcommerce.io/llms.txt
> Use this file to discover all available pages before exploring further.

# How Buy X Get Y Targets Are Chosen

> Understand how Buy X Get Y chooses which products to discount, including Quantity, Discount only the highest/lowest priced item, Max Uses Per Order, and products vs collections.

Use this page when you are setting up a **Buy X Get Y** offer and need to control which cart items receive the discount.

This applies to:

* Buy X get Y free
* Buy X get discount on Y
* Buy X get Y at fixed price
* Advanced Buy X Get Y

## Quick Guide

When several products are listed under Customer Receives, decide whether they are choices or a group:

* **Get ONE of these products free/discounted** → Enable **Discount only the highest/lowest priced item**, or use a single collection target with **Quantity** `1`.
* **Get EACH of these products free/discounted** → Leave the checkbox disabled.

You only need to change an existing offer when Customer Receives lists **multiple individual products** and you intend only **one** free or discounted item. Offers that target a **single product**, a **single collection with Quantity** `1`, or that intentionally discount **each** listed item already match that intent.

Then remember:

* **Quantity** controls how many units of each target can be discounted per application.
* **Max Uses Per Order** controls how many times the overall offer can repeat.
* **Highest first / Lowest first** only determines which eligible product is selected when Atom needs to choose between multiple targets.

## Two Parts of a Buy X Get Y Offer

A Buy X Get Y offer has two parts:

* **Customer Purchases** — the products the customer must buy to qualify for the offer
* **Customer Receives** — the products that are eligible to receive the discount (labeled **Customer Receives Free Products**, **Customer Receives Discount On**, or **Customer Receives Products at a Fixed Price**, depending on the template)

Several settings determine how the discount is applied. Each controls a different part of the offer.

## Quantity

When you add specific products or collections under Customer Receives, each row has its own **Quantity**.

Quantity controls how many units of **that specific target** can be discounted each time the offer is applied.

For example:

| Customer Receives | Quantity |
| ----------------- | -------- |
| Beanie            | 1        |
| Scarf             | 1        |
| Gloves            | 1        |
| Socks             | 1        |
| Belt              | 1        |

This creates five separate eligible targets, each with a quantity of 1. That means each listed product can contribute its Quantity toward the discount in a single application—not one unit chosen from the list. When the qualifying and receiving products come from the same set, some units are first reserved as qualifiers, so fewer items are discounted—see the example below.

It does **not** mean “choose one product from this list.”

As a result, if several of these products are in the cart, more than one may receive the discount unless you also enable **Discount only the highest/lowest priced item**.

<Callout>
  <strong>Example: default behavior with individual products</strong>

  <br />

  Offer: Buy any 2 accessories, get 1 free. Customer Receives lists beanie,
  scarf, gloves, socks, and belt individually, each with Quantity
  <code>1</code>, and the checkbox is off.

  <br />

  Cart has all 5 items. Atom uses 2 as qualifiers. The other 3 matching
  targets can all receive the discount in that one application—so the cart can
  show 3 free items, not 1.
</Callout>

<Note>
  If you set <b>Unlimited Quantity</b> on a target, Atom can discount all
  eligible units of that target in one application. That is not the same as a
  classic “get 1 free” setup.
</Note>

## Discount Only the Highest/Lowest Priced Item

Under **Target Options**, use **Discount only the highest/lowest priced item** to control whether products listed under Customer Receives are treated as choices or as separate discount targets.

The checkbox wording follows your **Discount Strategy** setting (highest first or lowest first).

| Setting           | Behavior                                                                                                                                    |
| ----------------- | ------------------------------------------------------------------------------------------------------------------------------------------- |
| **Off** (default) | Each eligible target can receive the discount. If several different eligible products are in the cart, multiple products may be discounted. |
| **On**            | Atom selects one eligible target each time the offer is applied. Highest first or lowest first determines which eligible item is selected.  |

For example, for:

> Buy any 2 of these products, get 1 free

If several products are listed under Customer Receives, enable **Discount only the highest/lowest priced item**. This tells Atom that the products are choices for the free item and that only one should be selected for each application of the offer.

With that setting on, the same 5-item cart becomes: 2 items qualify, 1 item is free, and 2 items remain full price in that application. Raise **Max Uses Per Order** if you want the offer to repeat when the cart has enough items for another Buy 2 Get 1 group.

<Tip>
  <b>Discount Strategy</b> (Highest priced items first / Lowest priced items
  first) only decides which eligible product is preferred when Atom needs to
  choose. It does not, by itself, limit the offer to one discounted item.
</Tip>

## Max Uses Per Order

Under **Discount Limits**, **Allow multiple uses per order** and **Max Uses Per Order** control how many times the entire offer can repeat within the cart.

By default the offer applies once per order. Enable **Allow multiple uses per order** to reveal the **Max Uses Per Order** field and allow it to repeat.

The table below is for a same-product or same-collection Buy 2, Get 1 Free offer where qualifying items and free items come from the same pool. It also assumes only one free item is selected per application—either because Customer Receives uses a single collection with **Quantity** `1`, or because **Discount only the highest/lowest priced item** is enabled. Cross-product offers count the Buy X and Get Y sides separately.

| Eligible items in cart | Free items earned |
| ---------------------- | ----------------- |
| 2                      | 0                 |
| 3                      | 1                 |
| 4                      | 1                 |
| 5                      | 1                 |
| 6                      | 2                 |
| 7                      | 2                 |
| 8                      | 2                 |
| 9                      | 3                 |

If **Max Uses Per Order** is `1`, the offer can only be applied once, so at most one free item is earned.

If **Max Uses Per Order** is higher, the customer can earn additional free items each time they satisfy the Buy 2 requirement again.

**Max Uses Per Order** is separate from the **Quantity** configured on individual targets. With multiple individual products and the checkbox left off, one application can still discount several targets at once, so raising Max Uses does not create classic Buy 2 Get 1 grouping by itself.

<Note>
  For same-product or same-collection Buy X Get Y offers, the first free item
  usually requires both the Buy quantity and the Get quantity in the cart. For
  Buy 2 Get 1 Free, that means 3 eligible items for the first free unit. See
  [Same-Product / Same-Collection Upsell Math](/offers/types/buy-x-get-y#same-product--same-collection-upsell-math).
</Note>

## Specific Products vs Collections

There is an important difference between adding several individual products and selecting a collection.

If you add several individual products under Customer Receives, Atom treats each product as its own target definition. Unless **Discount only the highest/lowest priced item** is enabled, every matching target can receive its **Quantity** in a single application.

If you select a collection, Atom treats the collection as one target definition containing all products in that collection. The collection’s **Quantity** caps how many units from that whole pool are discounted per application.

For example:

> Buy any sweater, get one item from the Accessories collection for 50% off

Using Accessories as a single target with **Quantity** `1` already groups those products together. You do not need to enable **Discount only the highest/lowest priced item** simply to prevent every eligible product in the collection from being discounted.

If you raise the collection **Quantity**, or add more than one collection as separate targets, more than one unit can be discounted per application again.

## Related Resources

* [Buy X Get Y](/offers/types/buy-x-get-y)
* [Advanced Buy X Get Y](/offers/types/advanced-buy-x-get-y)
* [Prorated Discounts](/offers/prorated-discounts)
* [Allow Multiple Uses Per Order](/discount-limits/multiple-users-per-order)
* [Creating Offers](/offers/creating-offers)
