Discount logic and structure
Written By John Osvald
Last updated 10 months ago
Discount
Discount in this context will mean any of
Lowered price on a cart→order
Lowered price on an item in the cart→order
Free shipping
Gift with purchase, a free item added to the cart→order.
Price is either lowered by a percentage or a fixed amount.
Discount Rules
Discount rule is the group term that holds all information necessary to apply discount to a cart and list information down on items, which items got discounted by which discount rules. They are always applied in the cart step of the shopping flow, which is why “cart” will be referred to instead of “checkout” or “order” from now on. In the Brink Commerce merchant portal discount rules are what you create every time. They can be any of
Brink code rule - Discount rule applied to the cart with a code if conditions are met.
Cart rule - Discount rule applied to the cart automatically if conditions are met.
External Rule - Discount rule applied to the cart with a code created by an external provider if conditions are met.
More information about these further down.
Logic rules
Inside a logic rule are all information that can discount the cart. The type of logic is split into two lists, conditions and outcomes. Conditions are light weight confirmations of cart content. Every condition needs to be met on the cart to then attempt to apply the list of outcomes. Outcomes holds the logic that decides what items will have a discounted price or if there should be free shipping etc. Some outcomes have internal conditions like lowering the price of a certain item. If that item happens to not be in the cart even though the list of conditions are met by the cart, the logic rule is still considered to not have its conditions met. As long as any of the outcomes are applied the logic rule is considered successful.
A discount rule has a list of logic rules. While only having one logic rule in the list is common, if there are more, only outcomes in one logic rule can be applied at a time. The discount rule will attempt to apply the first logic rule in the list and if no discount could be applied it will then attempt the second in the list and so on.
Using many logic rules is a way to set up ladder discounts. Start by having the toughest conditions in the first logic rule and go down the ladder for the coming logic rules. It is also possible to use the fact of having OR operators between logic rules in other ways. One is to reach the same outcomes but with different conditions.
Item selection
The sellable item in Brink is called product variant. On those merchants can set tags. Tags are used in conditions and outcomes to filter what items are required to be in the cart to meet the conditions on a logic rule and also to decide what items are eligible to get a discounted price. It is also possible to exclude items with a sale price lower than their base price and the other way around, an item with a sale price that is equal to its base price. This is what item selection will mean in this context.
Conditions
A list of condition types
Cart over threshold - Require the total price on the cart to be over a threshold.
Minimum cart items - Require items to be in the cart. The items selected and the total quantity of those items in the cart determines if the condition is met.
Minimum cart items value - Require the sum of selected items prices in the cart to be over a threshold.
Store group - Store groups represent store fronts and sales channels etc. Carts are started in a store group. Every store group has an unique id that can be set as a condition for a logic rule.
Country code - Carts are started in a country just like they are started in a store group. Matching the corresponding country code can be set as a condition.
Outcomes
A list of outcome types
Cart discount - This outcome directly lowers the price of the cart.
Item discount - This outcome lowers the price of all selected items.
Item discount with quantity - Similar to the one above it lowers the price of selected items but up to a predetermined quantity. If more items than that quantity are in the cart, the more expensive items will be prioritized for the discount.
Example:
Discount quantity = 2
Discount value = 50%
Cart = Item1 100:-, Item2 200:-, Item3 300:-
In this example item2 and item3 would have their price lowered and the total discount would be 250:-.
Free shipping - This outcome will pass down to the shipping provider that shipping cost should be zero.
Shipping tags - Some shipping providers allow for different pricing models where tags can be passed down to lower shipping cost.
Gift with purchase - Any configured product can be selected as a gift. This item is added automatically to the cart and will always have price zero.
Buy X get X - Buy a predetermined quantity (trigger quantity) of selected items and get a lowered price on less or equal quantity (discount quantity) of those. Buy one get one (BOGO) would be this type of outcome. If more items than the trigger quantity are in the cart the more expensive items will be selected. Among the selected items the cheaper items will be selected as discount quantity.
Example:
Trigger quantity = 2
Discount quantity = 1
Discount value = 50%
Cart = Item1 100:-, Item2 200:-, Item3 300:-
In this example item2 would have its price lowered and the total discount would be 100:-.
This outcome can be set as recurrent which means that if the total quantity of items in the cart are many multiples of the trigger quantity the outcome can be applied just as many times.
Buy X get Y - Buy a predetermined quantity (trigger quantity) of X selected items and get a lowered price on up to a predetermined quantity (discount quantity) of Y selected items. This discount requires the merchant to configure two sets of items, one for the items that will trigger the outcome and one for the items that can get discounted by the outcome. The more expensive items in the discount quantity set will be prioritized to get a lowered price.
Example:
Trigger quantity = 2
Discount quantity = 1
Discount value = 50%
Cart = Item1 100:-, Item2 200:-, Item3 300:-
Items for trigger quantity = Item2, Item3
Items for discount quantity = Item1
In this example item1 would have its price lowered and the total discount would be 50:-.
This outcome can also be set as recurrent.
Buy X get X with sub outcomes - This outcome works the same as the one above but you can add many combinations of trigger quantity, discount quantity, and discount value. The outcome will then optimize which combination of sub outcomes will provide the best discount on the selected items.
Example:
Sub outcome 1:
Trigger quantity = 3
Discount quantity = 1
Discount value = 100%
Sub outcome 2:
Trigger quantity = 2
Discount quantity = 1
Discount value = 50%
Cart = Item1 100:-, Item2 200:-, Item3 300:-, Item4 400:-, Item5 500:-
In this example sub outcome 1 will use Item3-5 and lower the price of Item3 to 0:-. Sub outcome 2 will use Item1-2 and lower the price of Item1 to 50:-. Total discount on cart is 350:-.
Stacked variants or parents - Product parents are the container entity for related product variants. This outcome can either stack selected items based on product variant or shared product parent. Every stack of items will be checked against configured quantity thresholds that give different levels of price lowering discount on the items. All stacked items will get a lowered price.
Example:
Type = Stacked variants
Threshold 1:
Trigger quantity = 2
Discount value = 20%
Threshold 2:
Trigger quantity = 5
Discount value = 40%
Cart = 3x Item1 100:-, 5x Item2 200:-
In this example 3x Item1 only meets Threshold1 and gets a total discount of 60:-. 5x Item2 meets Threshold2 and gets a total discount of 400:-. Total discount on cart is 460:-.
Sorting
A discount rule has a configured sort order. A number that determines when amongst other active discount rules it is its turn to try and apply outcomes to the cart. Depending on when a discount is applied it can affect how much the price is lowered. It can also affect the conditions based on price, if the price is lowered due to earlier discount rules the coming might not reach a required price threshold.
There are three types of properties on discount rules that also handle overlaps
Stackable - Only stackable discount rules can be applied together on a cart.
Exclusive - Only one exclusive discount rule can be applied per cart. Not configurable on cart rules.
Apply last - These discount rules are considered after the others and don't block non stackable or exclusive discount rules. They can still be set as exclusive amongst themselves. Not configurable on cart rules.
Code rules
This discount rule can only be used through discount codes. This is done by separately creating codes either through the API or the merchant portal and connecting them to the discount rule.
Cart rules
This discount rule tries to apply itself automatically on the cart.
External rules
This discount rule can only be used through external providers. The method to add it to the cart can differ between different providers. Some set up codes and connect them similarly to how codes work in Brink.