Broadleaf Microservices
  • v1.0.0-latest-prod

OfferService Stacking and Combinability

The Offer Service provides mechanisms for controlling how offers work together within an order

Default Combinability

By default, offers can be used together to discount different parts of the cart.

For example, consider a cart with 2 line items (A and B) with the following eligible offers setup:

  • 10% off order

  • 5% off order

  • $5 off item B

  • $2 off any item

The offer engine by default would allow at most 1 order level offer in this case, the 10% off order offer. It would not allow the 5% order offer since it is attempting to discount the same target as the 10% off order offer.

The offer engine would apply the $5 off item B to item B and the $2 off any item to item A. These default behaviors ensure that the best offer applies.

Stacking

In some cases, an implementation may want to allow two offers of the same type to apply to the same discount target. In the example above, if we could, for example, set one of the order offers as "stackable" which would then "stack" that discount on top of the other.

Stacking is sometimes used to support something like a loyalty offer which might allow an additional discount on top of other discounts for which the customer might be eligible.

Combinability Strategy

The combinability strategy determines how an offer will interact with other offers.

The system supports four out of box combinability strategies:

  • Default - Results in always for item offers and other types for order offers

  • Always - This offer can always be used with other offers

  • Other Types - Allows the offer to be combined with offers of other types

  • Never - This offer can never be used in the same order as any other offer

Tip
Note, while multiple item offers are ALWAYS considered as the default, this doesn’t mean that the user will get multiple discounts on the same item. By default, they will not; however, there are additional controls to allow a single item quantity to receive multiple discounts.

Combinability Overrides

A combinability override allows for an explicit override of the default rules. For example, an offer can be set to explicitly combine with another offer.

This is similar to stacking. A key difference, is that if an order is set to stackable, then it can combine with any other offer.

A combinability override could be used to allow an offer to only stack with a specific order or set of orders or for a stackable offer to stack with other offers except for a specific set of offers.

Item Combinability

Generally, an implementation should have item offers use a combinability strategy of ALWAYS. This matches the typical consumer expectation that discounts for different item types will apply.

At the same, time, when offers can apply to the same item, it is typical for them not to apply. The example described above where Item A gets 10% off and Item B gets 5% off illustrates this. The cart has two offers that qualify. Item A qualifies for both the 10% off and the 5% offer. By default, the system will only allow Item A to get the best offer which in this case is 10%.

This works because the offer engine looks at each item to find the best offer for that item. If it is desired to have more than one discount apply to the same item, then the offer can be setup as stackable which will let the discounts for a single item stack. Alternatively, a combinability override can be used to target specific offers that are allowed to stack.

Tip
For BOGO offers, the qualifier is not allowed (by default) to be used as a qualifier or target for another offer. This behavior can be overridden using advanced settings during offer setup.

Exclude items from Order Offer totals

In some cases, you may wish to prevent items that have already been discounted from counting towards the qualifying subtotal of an order-based offer. To exclude these items from the subtotal, you can set the property in the admin offer config, Offer#excludeDiscountedItemsFromTotals to true.

Priorities

In some cases, you may want to override the system’s algorithm for "best offer wins". This can be done by setting an explicity priority. For example, if you have a 5% off offer and a 10% off offer and you want the system to use the 5% off offer, set the priority for the 5% offer to 1 and leave the priority blank on the 10% off offer or set it to 2 or more.