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.

What is combined and what is not

The discount group decides which cart lines have their quantities added together before the tier is picked. It is worth being explicit about what this does and does not depend on:

Combined?
Two lines from the same options config, with different option values (different names, colours, uploads) Yes. Personalization does not split the group. Ten engraved items with ten different names still reach the tier for ten.
Two lines from the same config, on different products Yes by default, because the group is the config. Use {product} if each product should count on its own.
Two lines from different options configs No by default. Give both configs the same static group name to combine them.
Two lines that should each count alone (unique customizations) Use {random}.

It is not possible to pool quantities only across lines whose selected option values match — for example "same design and same colour count together, different sizes count separately". The group is resolved per cart line from the discount group field; it cannot read the customer's selections. If you need per-value tiers, create one Quantity discount option per value and show or hide each one with a condition.

Besides the three variables above, the field also accepts:

Value Description
(left empty) The default: all lines from this options config are combined.
Any fixed text, e.g. bulk-order All lines using that same text are combined, across products and across configs.
{product}-{variant} Variables can be combined. Only the same product and variant count together.

Linked add-on products

An add-on product linked to an option cannot have its own quantity discount. Quantity tiers belong to the Quantity discount option on the main product. The add-on price is still taken into account: as described above, the discount is calculated from the total product price including the add-ons.

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:

  • price    the current product price (base price + all option price add-ons)
  • discount    the 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)
  • quantity   the quantity of the current tier (e.g 10, 20, 30)

Return value

  • number    representing the absolute discount amount to apply for that tier.
  • string    with % 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.

Did this answer your question? Thanks for the feedback There was a problem submitting your feedback. Please try again later.