To discount only the cheapest items in a cart, use OneCode: Stackable Discounts. On a Product Discount, click Add quantity limit, enter how many items get the discount, and keep Apply discount to on Cheapest items first. Only that many items are discounted, starting with the lowest-priced. Choose Most expensive items first to discount the priciest items instead. Add a Group Quantity condition to make it “buy 2, get the cheaper one half price”.
Example: 50% off the 2 cheapest shirts
The code SHIRTS50 takes 50% off the Shirts collection, limited to 2 items, cheapest first. A customer buys shirts at $40, $30 and $25:
- The $25 shirt is $12.50 and the $30 shirt is $15.
- The $40 shirt is full price.
- The customer pays $67.50 instead of $95, $27.50 saved.

With Most expensive items first, the $40 and $30 shirts get 50% off instead. The customer pays $20 + $15 + $25 = $60, $35 saved.
The limit counts items, not products. Three of the same $25 shirt means two are $12.50 and one is $25.
Set it up
- In OneCode, click Create discount. Choose Discount code and enter a code, or choose Automatic discount and give it a Title.
- Click Add Discount Type. Keep Product Discount and Percentage, and enter
50in Percentage. - Set Target to Specific Collections, click Browse and pick Shirts.
- Click Add quantity limit. Enter
2in Quantity Limit and keep Apply discount to on Cheapest items first. - Click Save discount.
Second item half price
For “buy 2, get the cheaper one 50% off”, make two changes to the setup above:
- Enter
1in Quantity Limit, cheapest first. - Under Per-Discount Conditions, click Add Condition. Set Field to Group Quantity, Operator to Greater than or equal to and Value to
2.
A customer with a $40 shirt and a $30 shirt pays $40 + $15 = $55. One shirt on its own is full price, because the group has only one item. Group Quantity counts only the Shirts items, so a hat in the same cart doesn’t help reach 2.
Enter 100 instead of 50 and the cheapest item is free. That’s buy one, get one free, covered step by step in the BOGO guide.
Add free shipping or a second discount
The same code can carry more than the cheapest-item discount. Add a Shipping Discount with Free Shipping, or a second Product Discount on another collection. To make shipping free only when the shirt discount applies, give the shipping discount the condition Match Another Discount’s Rules and tick the shirt discount. A Shopify discount code holds one kind of discount, so this would otherwise take two codes. See a discount code with free shipping.
Things to check before you launch
- The quantity limit is per order, for this discount type only. With a limit of
1, a customer who buys four shirts still gets one shirt half price. To discount two items from four, set Quantity Limit to2and Group Quantity to at least4. - Apply discount to only appears when there’s a choice: when Target is All Products or Specific Collections, or more than one specific product.
- Items left out by Exclude sale items or an Item has subscription condition don’t count toward the limit or toward Group Quantity.
- For different percentages at 2, 3 and 4 items rather than a discount on the cheapest ones, see buy more, save more.
OneCode costs $9.90 USD every 30 days after a 7-day free trial, billed by Shopify. Install it from the Shopify App Store.

