Skip to content

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

Create a buy one, get one free discount code in Shopify

A buy X, get Y promotion rewards a fuller cart with a free item. This tutorial sets up BUY2GET1, a code that gives one free Summer Tee with every two bought, running 11 to 30 November 2026.

Written · Shopify admin, desktop steps · 5 minutes read

The worked example

CodeBUY2GET1
OfferBuy 2 Summer Tees, get 1 free
Gets value$30.00 per set
Active11 to 30 November 2026
3 tees, $90.00$30.00 off, pays $60.00
6 tees, $180.00$60.00 off, pays $120.00
2 tees, $60.00No discount

Download the planner: buy-x-get-y-cart-worksheet.csv (135 bytes).

A worksheet for the worked example carts: how many tees, how many 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 BUY2GET1. To generate a random discount code, click Generate code.

3Set what the customer buys

In the Customer buys section, select Minimum quantity of items and set the number to 2. In the Any items from section, select Specific products and add the Summer Tee. Only that product counts as a buy item.

4Set what the customer gets

In the Customer gets section, set the quantity to 1. In the Any items from section, select Specific products and add the Summer Tee. In the At a discounted value section, select Free. The other choices are Percentage and Amount off each.

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 usage limits, if you want them

Discount usage is unlimited by default. To limit it, check one or more of the options in the Maximum discount uses section: a total limit across all customers, or Limit to one per customer, which Shopify enforces by tracking a customer's email address or phone number.

7Set 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.

8Save

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

The arithmetic

Each set of two bought tees gives one free tee.

TeesCart totalFree teesPays
2 tees$60.000$60.00
3 tees$90.001 — $30.00 off$60.00
6 tees$180.002 — $60.00 off$120.00

The free item is never added to the cart on its own: the customer has to add all three tees by hand. A cart with two tees and no third tee gets no discount, even though the customer bought the two.

Held at the counter

The customer must add the free item by hand. The free or discounted get item is never automatically added to the cart. A customer who buys two tees and never adds the third gets no discount at all.

Watch the stock of the free item. If the inventory of the free product drops to zero, it shows as sold out and customers cannot take advantage of the discount. Check stock before launch.

The discount does not apply on the post-purchase page. A buy X, get Y discount created in the admin applies in the cart and at checkout, but not to the post-purchase page.

Sources

  • Buy X get Y discounts — Shopify's help pages: the create-a-Buy-X-get-Y-code steps, the rule that the get item is never added automatically, the inventory note, and the post-purchase page exclusion.