Discount Interaction
This guide describes how multiple discounts interact with each other.
Discounts are evaluated according to their priority order. By default, if multiple discounts can apply then they will.
E.g. if you have two discounts setup like below and the basket has 4 shirts, both of them will apply.
- Buy 4 shirts, get 20% off one
- Buy 3 shirts, get 10% off one
If you want to control this behaviour you have the following options:
- Add a condition to a discount to ignore line items that have already been used as conditions for other discounts
- Add a condition to a discount to ignore line items that have already been discounted
Ignore Used Condition Items
When a discount applies, the engine marks any line items that were used as conditions for that discount.
This allows discounts to ignore line items that have already been used as conditions by previous discounts.
This is done by adding a clause to the line item filter where the "Used as Money Off Condition" property is false
.
Ignore line items that have already been discounted
This is done by adding a clause to the line item filters to say "Discounted Price" equals "Price".
Example Discount Setup
So for the example above, the second discount could be marked to ignore items that have been used as conditions. The evaluation logic will then apply like so:
- The first discount will apply and mark the 4 items as used.
- The second discount will find no items that haven't been used as conditions and therefore not apply.
Below is an example of how to do this in the management tooling.
Discount 1
The "Buy 4 Get 20% Off" discount is setup like below:
Notes:
- "Max Items Per Application" is used to ensure the discount only applies to one line item.
- A "Product Type" property has been created on the "Line Item" object property
Discount 2
The "Buy 3 Get 10% Off" discount is setup like below:
With this discount setup, if a basket with 4 items is evaluated both discounts will apply.
To prevent this, we can update the "Buy 3 Get 10% Off" discount to add an additional clause to the line item filter:
Now, if a basket with 4 items is evaluated only "Buy 4 Get 20% Off" will apply.
Cost based actions
A dynamic property called Original[Cost Name]
(e.g. OriginalShipping
) is set to the original value of the cost. This allows writing expressions such as "only apply if the original and current cost are the same".
This provides a way of only applying a discount if a discount hasn't already applied to the cost.
For example, you may setup two discounts:
- Spend over 70 GBP to get 70% off shipping
- Spend over 30 GBP to get 50% off shipping
You probably don't want both discounts to apply if the customer spends over 70 GBP because the customer would get 70% off + 50% off the remaining cost. As a result you add a clause to the second discount to prevent it from applying if the cost has already been discounted.
Shipping Discount Example
Create two discounts: "Spend over 70 GBP to get 70% off shipping" and "Spend over 30 GBP to get 50% off shipping" to give money off a cost called "Shipping".
An example of the "Spend over 70 GBP to get 70% off shipping" discount is shown below:
Now we need to setup some properties. Cost names are dynamic (not predefined) so you need to ensure some cost properties are created so you can use them on the discount condition.
Firstly, create a top level object property called "Costs".
Then create two child properties: "Shipping" and "OriginalShipping".
The eligibility expression on the "Spend over 30 GBP to get 50% off shipping" discount condition can then updated like so:
This will prevent the second discount from being applied if the "Shipping" cost has already been reduced.