Sales season is a great time for you to win customers with the best deals. However, you have to remember that your store is not the only one with something to offer.

That is why you should explore the most effective ways to attract customers. One of them is Magento 2 Buy X Get Y Free sales rule which we're going to cover today.

So, the Buy X Get Y Free is a cart price rule that allows customers to get Y quantity of a product for free if they purchase X quantity of the same product.

Create Buy X Get Y Free in Magento 2

1. Fill out the cart price rule information.

2. Define the cart Conditions that determine when the rule is triggered (the cart state). If the conditions are not met, the order won't qualify for a discount.

Cart Price Rules Conditions in Magento

3. Set up Actions.

  • Select to Apply the Buy X get Y(discount amount is Y) discount.
  • Specify the Discount Amount. It is the number of products that customers will receive for free. 
  • Enter the Maximum Qty Discount is Applied To to limit the number of items you want to give out for free.  It is calculated by a formula we'll cover in the examples.
  • Set the Discount Qty Step (Buy X) to specify how many products customers can purchase to get Y of free items.
  • Enable the Discard subsequent rules option if you don't want other discounts to be applied. 
  • Set Conditions to apply discounts to specific cart items based on their attributes. If you want to apply the Buy X Get Y Free discount to all cart items, leave it blank. 
  • Choose whether to apply the discount to Free Shipping.

Cart Price Rule Actions in Magento

Don't forget to finish up with the rest of the cart price rule options and generate coupons automatically, if it is applicable to your rule.

Then, test the Buy X Get Y Free discount and see how it works on the storefront. To help you out we gathered examples of this discount. 

Examples of Buy X Get Y Free Discount

One of the most important things about the Buy X Get Y Free in Magento you should know is that it is based on row total. It means that items you purchase and get for free have to be from the same SKU.

e.g. if you purchase products from A, you get the same product from category A for free.

Limit freebies to categories

In case you want to limit the number of free items to certain categories, set up the following rule:

Cart Price Rules Conditions

Limit free products to categories and get free ones from the selected SKUs

If you want to limit free items from any category and receive Y from certain SKUs:

Apply Cart Price Rule to Limited Items

Limit Maximum Qty Discount

When applying the Buy X Get Y Free discount you have to use a special formula to define the Maximum Qty Discount

Formula = (X+Y) * (M/Y), where

  • X = number of items purchased
  • Y = number of free items
  • M = Maximum number of free items allowed

So, to set up Buy 5 Get 3 Free you should fill out the formula like (5+2)*(4/2)=(7)*(2)=14.

Buy X Get Y Free Magento

Follow the example and create other rules, if you want to give away more items for free.

Regular discounts in Magento and any other eCommerce platform is what makes your customers more loyal and encourages them to come back. However, remember that cart price rules are not the only way to apply discounts in Magento 2. 

Explore the catalog price rules to add discounts to catalog items directly.