If X, then do Y

When-Then - When Customer Buys X, Customer Gets Y

With the When-Then flag, you can create more complex rules by separating the discount logic into two parts:

  • Customer Buys (When): This part defines the criteria that must be met in the customer's cart for the discount to be eligible, and start checking the `then` conditions. It's the evaluation criteria.

  • Customer Gets (Then): This part defines which items in cart receive the discount based on the rules setup in "Customer Buys" section. It's the application criteria.

Example: Let's say you want to offer a 100% discount on Product A when a customer buys 5 of Product B.


Video walkthrough


Set up a When-Then discount in the Rule builder UI

  1. Find the Settings icon next to your discount

  2. In the popup window that opens, select When-Then and click done

Here's how the example mentioned below is configured using the When-Then logic

Let's understand with an example

  • Customer Buys (When):

    • Condition 1: The customer must buy more than 5 units of Product B (Line Quantity of Product B > 5).

  • Customer Gets (Then):

    • Condition 1: The customer gets a 100% discount on Product A (Product IDs = Product A & When Quantity = 1).

Let's Test Our Logic on a User's Cart:

A customer adds the following items to their cart:

  • Item 1: Product A, Price = $20, Quantity = 1

  • Item 2: Product B, Price = $10, Quantity = 6

  • Item 3: Product C, Price = $15, Quantity = 2

Logic behind the discount application:

  1. Product B is present in cart (Item 2) and has a qty of 6, thereby satisfying when condition.

  2. Then `then` condition is checked for all items, but only (Item 1) meet this criteria and hence gets the 100% discount applied on it.

Last updated