Skip to main content

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.

note

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:

  1. A cart item filter to filter items by product category (in our example, cookies) and count them.
  2. A cart item filter to know how many groups of 3 packs of cookies are in the cart.
  3. A cart item filter to sort eligible items in the cart from cheapest to most expensive.
  4. A rule to issue give the cheapest pack of cookies for free for every 3 packs that the customer buys.

Filtering the cart items by product category and counting them

Let's filter the cart by product category so that we can 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.

  1. Open the Rule Builder for your campaign.

  2. Click Add Rules.

  3. Click Filter Cart Items at the top-right of the page.

  4. Click Add Filter Step.

  5. In Filter & Sort, click Filter items by condition.

  6. In Condition, select Item category (item) from the palette.

    note

    You can also select SKU of item (item).

  7. In the drop-down menu, choose Is one of.

  8. Type the types of cookies that are eligible for the offer. In our case, we write cookies1, cookies2, cookies3, cookies4, cookies5 and cookies6.

  9. Click Add Filter Step.

  10. In Calculate, click Counts the number of items in the list.

  11. In Saves as, type the name of the filter. For example, eligible_items_count.

  12. Click Save Filter.

You can see the filter in the Cart Item Filters section, over the Rules one.

tip

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 in the next section.

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.

  1. In the Cart Item Filters section, click Add Filter.
  2. Click Add Filter Step.
  3. In Select, click Select the first No. of items.
  4. Click the + button to the right of the Select box to access the palette and select eligible_items_count.
  5. Divide eligible_items_count by 3 in the formula by writing /3 after the attribute.
  6. Select eligible_items_count/3 with the mouse to display the rounding options.
  7. Click ROUND DOWN. We obtain ROUND_DOWN(eligible_items_count/3).
  8. Click Add Filter Step.
  9. In Calculate, click Counts the number of items in the list.
  10. In Saves as, type the name of the filter. For example, 3x_groups_count.
  11. Click Save Filter.

You can see the new filter in the Cart Item Filters section, below the previous filter. The kind of value assigned to it 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.

  1. In the Cart Item Filters section, click Add Filter.

  2. Click Add Filter Step.

  3. In Filter & Sort, click Filter items by condition.

  4. In Condition, select Item category (item) from the palette.

    note

    If you selected SKU of item (item) when creating the first filter, select it here again.

  5. In the drop-down menu, choose Is one of.

  6. Type the items that are eligible for the offer. In our case, we write cookies1, cookies2, cookies3, cookies4, cookies5 and cookies6.

  7. Click Add Filter Step.

  8. In Filter & Sort, click Sort items by attribute.

  9. In Sort by, select Price of item (item).

  10. Choose Ascending in the drop-down menu.

  11. Click Add Filter Step.

  12. In Select, click Select the first No. of items.

  13. Click the + button to access the palette and select 3x_groups_count.

  14. In Saves as, type the name of the filter. For example, cheapest_item_first.

  15. Click Save Filter.

You can see the new filter in the Cart Item Filters section, below the previous filter.

tip

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 create a rule to apply this BOGO offer.

Before you start, let's ensure we have enabled cart item flattening.

We can then create the required rule:

  1. In the Rules section, click Add rule.
  2. Type a name for the rule. For example, 3x2.
  3. In Conditions, click Add condition.
  4. In Attribute, click Validate attribute value.
  5. Select 3x_groups_count in the palette.
  6. In the drop-down menu, choose Is greater than or equal to.
  7. Enter the minimum number of eligible groups. In our case, let's write 1.
  8. Click Done.
  9. In Effects, click Add effect.
  10. Click Discount individual items.
  11. In Pick a list of items, select cheapest_item_first.
  12. In Discount name, type a suitable name. For example, 3rd item 100% off.
  13. Set Discount value to [Item.Price]*100%.
  14. Click Done.
  15. Click Save at the top-right of the page.

Now, when a customer purchases 3 packs of cookies, they will see a 100% discount applied to the cheapest of them.