I would like the customer to get the most expensive product for free when using the discount Buy 3 pay for 2, is that possible?
Topic summary
A merchant wants to implement a “Buy 3, Pay for 2” promotion where the most expensive item becomes free, rather than the cheapest (which is Shopify’s default behavior).
Key Challenge:
Shopify’s native discount system doesn’t support discounting the highest-priced item automatically.
Recommended Solutions:
-
Third-party apps (most accessible option):
- BOGOS: Free Gift Bundle Upsell - features “Discount on Most Expensive Item” functionality with free plan available
- Discount Ray – Wholesale Pricing - offers personalized discounts with 14-day trial
- Bold Discounts, Discount Ninja, DiscountYard, or Bundler
-
Shopify Plus stores: Custom Ruby scripts can automatically identify and discount the most expensive cart item when 3+ products are present
-
Manual workaround: Create discount codes with instructions for customers
Consensus:
Multiple respondents confirm this is achievable but requires either a specialized app or custom scripting. Screenshots demonstrate working implementations showing the most expensive product being discounted at checkout.
I totally get what you’re trying to do—you want your customers to buy three items, but the most expensive one should be the free one. By default, Shopify’s automatic discounts and basic discount apps usually apply the discount to the lowest-priced item, but you can make it work the way you want with a few tweaks.
Solution: Use a Shopify Discount App
Shopify’s built-in discount system doesn’t support “Buy 3, Get the Most Expensive Free” out of the box. However, you can use an advanced discount app like:
- Bold Discounts
- Discount Ninja
- Automatic Discounts & Gifts by StayTuned
These apps allow more customization, so you can specifically set the discount to apply to the highest-priced item instead of the cheapest one.
Alternative: Use a Shopify Script (Shopify Plus Only)
If you’re on Shopify Plus, you can use a custom Shopify Script to apply the discount to the most expensive item. Here’s an example of how you can do it using Shopify’s Ruby Scripts:
This script applies a discount to the most expensive item when 3 or more items are in the cart.
eligible_items = Input.cart.line_items.select { |item| item.quantity > 0 }
if eligible_items.size >= 3
most_expensive_item = eligible_items.max_by { |item| item.line_price }
most_expensive_item.change_line_price(0, message: “Free item!”)
end
Output.cart = Input.cart
This script finds the highest-priced product in the cart and makes it free if there are three or more items.
Workaround for Non-Plus Stores
If you don’t have Shopify Plus, you can:
- Manually create a discount code for “Buy 3, Pay for 2” and instruct customers to add three items to their cart.
- Use an app (as mentioned earlier) to automatically handle this without needing Shopify Plus.
- Set up a bundle deal where customers must add three specific products, and the system will apply the discount to the highest-priced one.
Final Thoughts
The easiest way to get this working is by using a discount app. If you’re on Shopify Plus, a custom script is the cleanest solution. Unfortunately, Shopify’s native discount settings don’t let you choose which item to discount automatically, so a third-party solution is your best bet.
Let me know if you need more details or help setting this up!
Thanks,
Daisy
Hi everyone! I hope I’m not too late in replying ![]()
I understand that you wanna allow customers to randomly add 3 products and get the most expensive one for free.
To achieve that setup, I recommend using BOGOS: Free Gift Bundle Upsell app (FREE plan available) — with its “Discount on Cheapest/Most Expensive Item.” (a quite exclusive feature o market now)
Set up (ask me anything if you have question)
Widget displayed in store:
Randomly add 3 products to cart, and get the most expensive for free
P/s: Here’s the updated tutorial on how to Create Discount On Cheapest or Most Expensive Item In Shopify
Hope my reply helped someone <3
Hello @Maggiebykakan,
Based on your requirements, you may consider trying the Discount Ray – Wholesale Pricing app.
This app includes a Personalized Discount feature that allows you to create custom discounts and enable automatic gift selection. In your case, you can offer the most expensive product as a free gift when a customer selects any three products—exactly as described in your use case.
Please feel free to review the uploaded demo product for reference.
The app also offers a 14-day free trial, giving you the opportunity to explore its features before making a commitment.
If you would like, we can also share a sample product setup to help you get started.
Thank you.
Sure, you can, but you’ll have to do it through an app or custom script. If you’re on Shopify Plus, you can use Shopify Scripts to automatically find the most expensive item in the cart and discount it. For standard plans, apps such as DiscountYard or Bundler can do this kind of logic pretty well.





