Buying 3 and paying for 2
Let's create a BOGO campaign for customers who buy 3 items from a given list of products or categories of products to get the cheapest one of them for free.
For example, if our business is a supermarket, we can give our customers the cheapest pack of cookies for free every time they purchase 3 packs out of 6 different types of cookies. They will get the 2 cheapest packs of cookies for free if they purchase 6, the 3 cheapest if they purchase 9, and so on.
To do this, let's use cart item filters.
We strongly recommend enabling cart item flattening for the campaign. Without flattening cart items, all packs of cookies of the same type are viewed as a single cart item with their total quantity.
Let's create:
- A cart item filter to filter items by item category (in our example, cookies) and count them.
- A cart item filter to know how many groups of 3 packs of cookies are in the cart.
- A cart item filter to sort eligible items in the cart from cheapest to most expensive.
- A promotion rule to issue give the cheapest pack of cookies for free for every 3 packs that the customer buys.
Filtering the cart items by item category and counting them
Let's filter the cart by item category to find in the cart all the packs of cookies that belong to the eligible types, and add a filter step to count them. This will allow us to use this information to create other filters.
Filter items by condition:
Attribute is Item category (Item).
noteYou can also select SKU of item (item).
Is one of
cookies1
,cookies2
,cookies3
,cookies4
,cookies5
andcookies6
.Add Filter Step: Counts the number of items in the list.
Save as
eligible_items_count
.
To the right of the filter name, you can see the kind of value assigned to our filter. In this case, it is number. This means that we can use it in arithmetic conditions.
Dividing the eligible items in the cart into groups of 3 and counting the groups
Let's create a second cart item filter to divide by 3 all eligible packs of cookies in the cart. The resulting number is rounded down.
This will allow us to know how many free items a customer can get in the same session. A customer can get a free pack of cookies for every 3 they buy. For example, if a customer buys 7 packs of cookies, they get the cheapest 2 for free.
Select the first No. of items:
Cart item filter from the palette is eligible_items_count.
Formula is
ROUND_DOWN(eligible_items_count/3)
.tipType
/3
and selecteligible_items_count/3
to display the rounding options.Add Filter Step: Counts the number of items in the list.
Save as
3x_groups_count
.
The kind of value assigned to this new filter is number.
Sorting eligible items in the cart from cheapest to most expensive
Let's create a third cart item filter to sort eligible items in the cart from cheapest to most expensive.
Filter items by condition:
Attribute is Item category (Item).
noteIf you selected SKU of item (item) when creating the first filter, select it here again.
Is one of
cookies1
,cookies2
,cookies3
,cookies4
,cookies5
andcookies6
.
Add Filter Step: Sort items by attribute.
Sort by: Price of item (item), where price is
Ascending
.Add Filter Step: Select the first No. of items.
Cart item filter from the palette is 3x_groups_count.
Saves as
cheapest_item_first
.
To the right of the filter name, you can see the kind of value assigned to our filter. In this case, it is list of cart items. This means that this filter will be available wherever other lists, such as the list of cart items, are available.
Giving the cheapest item for free for every 3 the customer buys
Let's build a promotion rule to apply this BOGO offer. When a customer purchases 3 packs of cookies, they will see a 100% discount applied to the cheapest of them.
Before you start, let's ensure we have enabled cart item flattening.
Let's name the rule 3x2 offer
. It has 1 condition and 1 effect.
Condition
Validate attribute value:
- Cart item filter is 3x_groups_count.
- Is greater than or equal to
1
.
Effect
Discount individual items:
- List of items is
cheapest_item_first
. - Discount name is
3rd item 100% off
. - Discount value is
[Item.Price]*100%
.