To run buy one, get one free with OneCode: Stackable Discounts, add one product discount to a code: 100% off a collection, with a quantity limit of 1 applied to the cheapest item first, and a condition that the cart has at least two items from that collection. When the customer has two items from the collection in the cart, the cheaper one becomes free. It works the same as an automatic discount. The customer adds both items to the cart; OneCode doesn’t add the free one for them.
Example
The code SOCKSBOGO covers the Socks collection. A customer adds Everyday socks at $12 and Wool socks at $15. The $12 pair is free, so the customer pays $15 plus shipping. One pair on its own is full price.

Set it up
- In OneCode, click Create discount. Choose Discount code and enter
SOCKSBOGO, or choose Automatic discount and give it a Title. - Click Add Discount Type. Leave it as a Product Discount, and enter
100in Percentage. Set Target to Specific Collections and pick the collection. - Click Add quantity limit. Enter
1in Quantity Limit and keep Apply discount to on Cheapest items first. - Under Per-Discount Conditions, click Add Condition. Set Field to Group Quantity, Operator to Greater than or equal to and Value to
2. Group Quantity counts only the items this discount type targets, so other products in the cart don’t count. - Click Save discount.
Variations
- Buy 2, get 1 free: set Group Quantity to at least
3. With three items, the cheapest is free. - Buy one, get one 50% off: enter
50instead of100. - Most expensive item free: set Apply discount to to Most expensive items first.
- Free shipping with the BOGO: add a Shipping Discount with Free Shipping to the same code. On its own, it makes shipping free on every order that uses the code. To give free shipping only when the BOGO applies, see shipping discounts that follow another discount.
- A different product free when they buy a specific one: see buy this, get that.
How many items are free
The quantity limit counts once per order. With a limit of 1, a customer who adds four pairs still gets one pair free, not two. To make two items free when the customer buys four, set Quantity Limit to 2 and Group Quantity to at least 4. That version gives nothing for two or three items, so pick the one that matches your offer.
Two of the same product count as two items, and one of them becomes free.
Shopify’s own Buy X Get Y discount only discounts the item the customer gets, so free shipping or money off other items would need separate discounts. With OneCode they go on the same code.
OneCode costs $9.90 USD every 30 days after a 7-day free trial, billed by Shopify. Install it from the Shopify App Store.
