This example deals with quantity discounts where you can set different prices for a range of quantities.
You need two subtotal elements in order to achieve this:
- The first subtotal element gets the value from the numbers element and applies the quantity discount
- The second subtotal element calculates the numbers element with the first subtotal element and overwrites the price to determine the final price.
First Subtotal Element
Open up the first subtotal element and select the calculation section. Add a calculation row to retrieve the quantity value.
Select the discount section and add your own quantity logic here, following this example:
In this example, the following logic applies:
- If the quantity value is below 10, then the subtotal value is set to 1
- If the quantity value is between 11 and 50, then the subtotal value is set to 0.8
- If the quantity value is above 51, then the subtotal value is set to 0.5
In other words, this subtotal element acts as the multiplier for the final calculation. For example, if the quantity value (which is retrieved in the calculation section) is 20, then the second discount row will be used.
Actually, you can also change the discount operator (third column) into “factor” in order to calculate the total price right away, but you won’t be able to see which quantity discount will be used. Sometimes, you don’t want to show this at all so you can change the operator here already.
Second Subtotal Element
The second subtotal element acts as the final calculation part.
Open up the second subtotal element and select the calculation section.
In this element, the following calculation logic applies:
- Retrieve the quantity value
- Multiply the quantity value by the first subtotal element’s value (1, 0.8 or 0.5 which equals 100%, 80% and 50%, respectively)