Skip to content

Shopify tutorials for the person running the store. Orders, discounts, fulfilment, returns.

Limit a buy one, get one discount to two uses per order in Shopify

A buy X, get Y discount repeats with every set the customer buys, unless you cap it. This tutorial sets up B2G1MAX, a buy 1, get 1 free code on the Socks collection, capped at 2 uses per order, running 11 to 30 November 2026.

Written · Shopify admin, desktop steps · 4 minutes read

The worked example

CodeB2G1MAX
OfferBuy 1, get 1 free
Maximum uses per order2
Active11 to 30 November 2026
6 items, $120.00$40.00 off, pays $80.00
Without the cap$60.00 off, pays $60.00

Download the planner: buy-x-get-y-max-uses-comparison.csv (154 bytes).

The worked example carts with the 2-uses-per-order cap in place: how many items are free, and what the customer pays.

1Open Discounts and start a new discount

From your Shopify admin, go to Discounts, then click Create discount. In the Select discount type menu, click Buy X get Y from the list.

2Choose the code method

In the Method section, select Discount code. In the Discount code field, enter a name for the code, for example B2G1MAX. To generate a random discount code, click Generate code.

3Set what the customer buys and gets

In the Customer buys section, select Minimum quantity of items, set the number to 1, and add the Socks collection. In the Customer gets section, set the quantity to 1, add the Socks collection, and in the At a discounted value section select Free.

4Set the maximum uses per order

In the Customer gets section, check Set the maximum number of uses per order and enter 2. The promotion can now apply at most twice on each order: two free items, however many sets the customer buys.

5Set who can use it

In the Eligibility section, choose which customers can use the discount. Select All customers for a public code. The other choices are Specific customers, Customer segments, and Markets.

6Set the dates

In the Active dates section, set the start date to 11 November 2026 and click Set end date to set the end date to 30 November 2026. If you do not set an end date, the code does not expire. Start and end times follow the time zone set in your Shopify admin.

7Save

Click Save to create the discount. The code appears on the Discounts page and is ready to use.

The arithmetic

Each set of one bought item gives one free item, at most twice per order.

ItemsCart totalFree itemsDiscountPays
2 items$40.001$20.00$20.00
4 items$80.002$40.00$40.00
6 items$120.002, capped$40.00$80.00

Without the cap, 6 items give 3 free: $60 off and the customer pays $60. The cap is what saves the $20 difference.

Held at the counter

The cap is per order, not per customer. A customer can place a second order and get the discount again. To stop that, check Limit to one per customer in the Maximum discount uses section.

A cap of 1 turns the offer into one free item per order. With the maximum set to 1, a customer who buys ten sets still gets one free item. Set the cap to match the offer you meant to make.

The customer must add the free items by hand. The free or discounted get item is never automatically added to the cart. A customer who adds only one item and never adds the second gets no free item at all.

Sources

  • Buy X get Y discounts — Shopify's help pages: the create-a-Buy-X-get-Y-code steps, and the Set the maximum number of uses per order setting.