Quantity discount
Enable extension
To enable the Quantity extension please visit: How can I add an Extension?
How does the extension work?
The quantity discount extension adds a new option type "Quantity discount" to the available option types.
Using the option, you can configure tiered discounts that are based on the number of quantities bought.
The total quantity is always re-calculated on the cart level before checkout, this allows to increase the quantity or combine multiple products of the same type to calculate the final discount value.
The app is also aware of the price add-ons and can calculate the correct discount values based on the total product price.
Config
On the product options config, you can find the option type:

Discount quantity
You can add discounts for different quantity levels:

Discount amount
You can either offer percentage based discounts, or absolute price reductions, you can change from percentage to absolute by clicking on the percentage icon:

Note: The absolute amount is deducted for each quantity.
Discount layout
The option will list each discount level. The levels are selectable and will update the quantity to match the level.

In the Advanced tab of the option, you can configure a custom discount template to control which elements are shown on the text:

In the example we removed the {compare} price to only show the new price and the discount amount:

Discount group
The total quantity is always recalculated at the cart level, this is required to find the correct discount level before checking out.
By default the quantity count of the products that have the same product options config are combined when they are in the cart.
If you want to combine other products, e.g you have different option configs but the quantity discount should be applied on the total of all the products, then you can configure a custom group name:

You can also use the following variables into the discount group field:
| Variable | Description |
|---|---|
| {random} |
Create a new group for each product in the cart. This ensures that quantities are not combined or summarized within the cart. |
| {product} |
Use the product ID to summarize the quantity in the cart. Useful if a single config is attached to many different products. |
| {variant} |
Use the variant ID to summarize the quantity in the cart. Useful if you want to only summarize the quantities of the same variant. |

Product
On the product page the discount option will show the total updated dynamically based on the current price of the product including the add-ons.

The main product price is always displayed as the single quantity price (without quantity discount applied). If you want to update the price to reflect the current quantity, you can add an attribute on your themes product price element for the app to update it based on the total selected quantity:
| Description | Selector | Example |
|---|---|---|
| Total quantity product price including discounts | [data-live-price-quantity=1234] | data-live-price-quantity="{{ product.id }}" |
| Single quantity product price including discounts | [data-live-price-quantity-single=1234] | data-live-price-quantity-single="{{ product.id }}" |

Cart
The cart will list the new total with the discounted price. When the quantity is changed, the discount level will be rechecked and updated:

Checkout
The discount is automatically generated on the Shopify checkout as Product discounts.
The customer can combine additional discounts that meet the requirements of Shopify Discount combinations. (Product discount(s) + Order discount)

The generated discount code text can be customized in the Advanced tab of the option > Discount Text:


Minimum order quantity
How can I validate a minimum order quantity?
Quantity Unit
It is possible to configure a different unit for the discount tiers to be based on, for example, square area m² or a total number of pages:

The option can be connected to another option that is used as the unit input source via Advanced > Quantity option:


Note: when connecting to an option of type Dimension, the area will be used as the unit.
The quantity unit will be multiplied by changes to the main product quantity:
quantity * unit = total unit
The displayed tiers will always display the single unit price discount:

The discount tiers are not selectable, as the input depends on the unit option value.
Discount Formula
For the most advanced use cases it is also possible to calculate a discount by using a formula. This requires the Price formula extension to be active on the plan.
Use cases:
- Discount changes based on other selected options (material, finish, size)
- Discount logic is complex or conditional (e.g., different rules for small vs. large orders)
- Final quantity-based prices stored in linked Price lists
- 2D pricing matrix (quantity × another option = price)
How it works
The formula is evaluated for each discount level, the result is used as the discount amount for that tier instead of the static discount value:

Important: it is required to predefine the discount tiers in order for the formula to be evaluated.
For the above example, the formula will be evaluated three times with the quantity variable set to (10, 20, 30).


Available variables
The following variables are available in the discount formula context:
pricethe current product price (base price + all option price add-ons)discountthe discount from the current tier which is the static discount amount defined in the tier (can be used as part of the formula or ignored for a fully dynamic calculation)quantitythe quantity of the current tier (e.g 10, 20, 30)
Return value
numberrepresenting the absolute discount amount to apply for that tier.stringwith % sign to represent a percentage discount (e.g., "10%").
Example: Cross-Option Dependencies
When the discount depends on other selected options (material, color, size, etc.).
let material = options.value('material');
let baseDiscount = quantity >= 10 ? 10 : 5; // Base tier discount
// Premium materials get extra discount
if (material === 'premium' || material === 'luxury') {
return baseDiscount + 5 + '%';
}
return baseDiscount + '%';
This applies an extra 5% off if the customer chose premium material, regardless of quantity tier.
Example: 2D Pricing Matrix (Quantity × Option)
When discount depends on both quantity AND another option (e.g., material, finish, color).
var material = options.value('material');
var list = options.list('Material Discounts'); // 2D matrix
var targetPrice = options.lookup(list, quantity, material);
// Return the difference as a discount amount
return Math.max(0, price - targetPrice);
The linked list defines target prices like:
- Standard material @ 10 qty = $25/unit, @ 50 qty = $20/unit
- Premium material @ 10 qty = $40/unit, @ 50 qty = $30/unit
Ask the AI assistant for help with discount formulas.