Achieve Quantity Price Breaks and X + Y

Topic summary

Goal: Implement tiered quantity price breaks (3 units: $35, 5 units: $30 from $40 base) and “buy 5, get 1 free,” keeping reduced pricing, on Shopify Plus with Hydrogen 2.

Constraints: Shopify Functions’ DiscountApplicationStrategy supports only First or Maximum, not All, limiting multi–line item application. Shopify allows only one discount per product; stacking price breaks with buy X get Y is not supported. Storefront API mutations (checkoutLineItemsAdd/Update) require a checkout ID.

Workarounds proposed:

  • Line item properties (e.g., price_break) to drive per-item discounts via a Function. Open question: can Product A (qty 5) get the 5-tier while Product B (qty 3) gets the 3-tier concurrently.
  • Hidden “free item” product added when threshold met to simulate buy 5 get 1 without stacking discounts.
  • Multiple variants per tier with programmatic switching on quantity changes (cart.changeLineItem); feasible but complex and potentially poor UX.
  • Custom app logic using Storefront API to combine price reduction and free item; or bundling for 5+ items.

Status: No timeline for ApplyDiscountStrategy.All. OP will test the line item property approach and explore combined logic; discussion remains open.

Summarized with AI on January 14. AI used: gpt-5.

Hi, @mwmax !

  1. You are right, Shopify doesn’t allow youto apply the price breaks to multiple lines items in cart because the ApplyDiscountStrategy only has two values: First and Maximum. There is no ApplyDiscountStrategy.All option yet. However you can try a workaround that I thought of:

You can create a custom line item property for each product that stores the quantity price break value and then use the Function to apply the discount based on the property. For example you can add a line item property called “price_break” with the value depending on the quantity of the product. Then in your function you can use the lineItem.properties.price_break property to determine the discount amount. That way you can apply the price breaks to all the products that have the line item property.

  1. You cannot combine the Buy X get Y discont with the price breaks as there can only be one discount per product. But there is another workaround. You can create a hidden product that represents the free item and then use the function to add it to the cart when the customer qualifies for the buy X get Y discount. For example you can create a product called “Free item” with a price of 0 and for example SKU of “FREE”. Then in your function you can use the cart.addLineItem method to add the free item to the cart when the customer buys at least those 5 items. This way you can offer the free item without applying buy x get y discount to the products.

Now your questions:

  1. You can add an item to the cart in the checkout without a discount function by using the cart.addLineItem method in your function. This method allows you to add any product to cart including hidden products. You can use this to add the free item to the cart when customer qualifies for the buy X get Y discount and the napply the price breaks to the products using the line item property workaround.

  2. Creating multiple variants per product with the 3 price points is another possible solution but it has some drawbacks. One of them is the scenario that you described, where the customer changes the number of items in the cart and gets the wrong price. To avoid this, you can use the cart.changeLineItem method in your function to change the variant based on the selected number of items. This allows you to change the variant ID, quantity and properties of a line items in the cart. You can use this to update the variant ID to the correct one based on the quantity of the product. For example if the customer changes the quantity from 5 to 4 you can use the cart.changeLineItem to change the variant ID from the 5 item price break variant to the 3 item price break variant.

  3. You can have a combo of both the buy X get Y discount and the price breaks by using the hidden product and the line item property workarounds. However this is not a very good solution as it involves creating extra products and properties that are not visible to the customer. A better solution would be to wait for the ApplyDiscountStrategy.All option to be available or just use a third-party app that can handle complex discounts.

  4. You can follow the Shopify Functions GitHub repository to stay updated on the latest developments changes.

Let me know if you have any other questions!

1 Like