Buy X get Y

How to buy 2 items and get another item as gift

In this tutorial, let's explore how to buy 2 pairs of shoes get 1 cap for free.

Discussion steps:

  • Pricing

  • Settings

  • Conditions

  • Application

To get started with this, we will go through YayCommerce >> YayPricing >> Product Pricing >> Add Rule. Then select the Buy X Get Y rule (the X+Y variation).


After selecting the Buy X Get Y rule, then we go ahead to configuring the price settings, as seen in the screenshot below;

(1). We give a name to our rule, this name is not shown to our customers, as it’s for our own reference purpose only.

(2). We choose the Free item option here because we want to give out one of our cap products for free, the Discount option means, we are not giving out the cap product but we just want to discount the price from the cart items.

(3). We do not need to check this box because we want the rule to be applied once and not repeatedly in the Cart (eg. 2 - 10 cart item = 1 free cap). If we uncheck the box, it means that the rule will be applied in multiples of 2 product counts in the Cart (eg. 2 - 10 cart item = 5 free cap).

(4). We selected the Any option, so that any one of the product filter criteria would have to be met before the rule can be applied to a customer, you can select the All option here if you set multiple filters and want all the filter criterion to be met before the rule can apply to a customer.

(5). This is the field where we add all the products that at least any one of them must be added to the cart before a customer can have our free caps.

(6). This is where we choose the All option in other to make sure that all the filter criteria must be met by the Get product before it is now applied to a customer.

(7). This is the field where we select or set the cap product we are giving out for free.


The screenshot below shows the settings that can be applied to our rule, There are up to 5 checkboxes that can be activated in order to apply the four available settings in this case, but we have only checked the box (1) to allow us show the offer description in product page.

(2). When this box is checked, it means the description set in box (1) will be shown to customers only when the Conditions set are matched.

(3). When this box is checked, it means customers would see a tooltip text on the final price in the Cart page after the pricing rule is applied to their cart items.

(4). You can check this box to schedule a start and end date to run your rule campaign.

(5). Check this box to limit the number of times a customer can enjoy the discount rule.


We do not need to set further conditions for this pricing rule, you can set conditions if you want to further define when the rule should be applied and when it should not be applied to customers.

We saved the changes!


Offer description in the X product page.

1 quantity of Y is automatically added to the cart after we've added 2 or more quantities of X product.

Last updated