The Most Popular Extension Builder for Magento 2

With a big catalog of 224+ extensions for your online store

How to setup Buy X Get Y Free in Magento 2

Free Gifts are always a common method of motivating spending, and if you want to sell in bulk, the Buy X Get Y Free promotion is a suitable approach. It is extremely useful if you want to promote particular items, clear stocks quickly, or are a wholesaler.


Free Gifts

Free Gifts for Magento 2

Retain customers and boost sales easily by offering free gifts

Check it out!


Setup Buy X Get Y Free is one of the actions when you create the Shopping Cart Price Rule, in which customers can receive an amount of discount (Y is the discount amount) if there is the quantity of products (X) you have set before and all conditions of the rule are met. The format of the discount will appear as the following:

Buy X quantity of product, get Y quantity for free.

In this tutorial, I will help you set up the Buy X Get Y Free promotion in Magento 2 with practical examples.

5 Steps to Set up Buy X Get Y Free:

Step 1: Set the Cart Price Rule

You can complete this step by following the topic: Create a Cart Price Rule

Step 2: Set the Conditions

  • On the Conditions tab, appears the statement “If ALL of these conditions are TRUE”

    The statement has two bold links “All”and “TRUE” to edit.

    • Click on the ALL link, ALL and ANY options are available.
    • Click on the TRUE link, TRUE and FALSE options are available.
  • Leave the conditions blank if you want to apply for all products

How to Create a Cart Price Rule Cart Condition Statement

  • Click on Add icon to set conditions for the rule:
    • Product attribute combination
    • Product subselection
    • Conditions combination
    • Cart Attribute

How to Create a Cart Price Rule Cart Choose Conditions

  • Continue tapping the Add icon and follow these steps again to add as many conditions of the cart price rule as you need
  • If you want to delete any statement, just hit the Delete icon to remove it.

Step 3: Set the Actions

  • In the settings of Cart Price Rule, choose the Actions.
  • Choose Buy X get Y free in the Apply field.
  • Enter the number for Discount Amount.
  • Limit the quantity discount that is applied by setting the Maximum Quantity Discount is Applied to 1, for example, this is the number of items that the discount can be applied on.
  • Set the required products customers need to add to his cart in the Discount Qty Step (Buy X) field.

Step 4: Set the Labels

  • Choose Labels tab.
  • Under the Default Label section, insert the text in the Default Rule Label for All Store Views.
  • Under the Store View Specific Labels, set the label for each store view,

How to Create a Cart Price Rule Cart Labels

Step 5: Apply the Rule

Click Save Rule to enable the rule.

As usual, the new rule will be available in an hour. In addition, you should test it correctly to ensure that it is perfect.

Other promotion campaigns you can use for your store

  • Buy the product with a fixed price after discount: Buy a bag at a price of $10, regardless of the original price.
  • Spend X amount and get Y discount amount: Get a discount of $5 for every $50 spending.
  • Spend X amount, get the cart discounted for Y amount: Get a discount of $5 for each cart of $50.
  • And other promotions based on purchase history, or order status.

Create Special Promotions for your store now

Related posts:

Examples of Buy X Get Y Free

Now, let’s see how it works in reality via these 4 examples:

Example 1:

If you offer the promotion: Buy 3 Get 1 Free with no maximum of free items allowed, we can set up the cart price rule like the following:

  • Apply: Buy X get Y free (discount amount is Y)
  • Discount amount: 1
  • Maximum Quantity Discount is Applied: 0
  • Discount Qty Step (Buy X): 3

Buy X Get Y Free image 1

Example 2:

If you offer the promotion: Buy 7 Get 3 Free with a maximum of 6 free items, you can apply the formula below to calculate the correct value for the Maximum Quantity Discount.

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

Where

  • X = The number of items the customer must purchase to get the discount.
  • Y = The number of items the customer will receive for free
  • M = Maximum number of free items allowed

So we have:

  • X = 7
  • Y = 3
  • M = 6

Using the above formula, we can determine exactly the maximum quantity of discount that can be applied when the condition is satisfied:

Maximum Qty Discount = (7+3) * (6/3) = 20

So we set up buy 7 get 3 free as the following:

  • Apply: Buy X get Y free (discount amount is Y)
  • Discount amount: 3
  • Maximum Quantity Discount is Applied: 20
  • Discount Qty Step (Buy X): 7

Buy X Get Y Free image 2

Example 3:

In case you want to limit the free product to categories A, B, and C, set the actions as below:

If ALL of these conditions are True: Category is one of A, B, C

For example: To limit the free product to categories 26, 15, 18, you need to set the actions as below picture:

Buy X Get Y Free image 3

Example 4:

You can limit the free items from any category A, B, C, and receive the free items from SKUs D786, E876, and F187 by setting the below action:

If ALL of these conditions are TRUE: SKU is one of D123, E123, F123

For example: To receive the free item from SKUs 24-MB01 and 24-MBO4, you need to set the rule as below image:

Buy X Get Y Free image 4

  • Click to the Save and Continue Edit button to edit the rule as you expect.

FAQs

1. What is the difference between Buy X Get Y Free and Cart Price Rules?

The main difference between “Buy X Get Y Free” and “Cart Price Rules” in Magento 2 is their application. “Buy X Get Y Free” gives a free item (Y) when a customer buys a certain amount of another item (X), promoting specific product purchases. Cart Price Rules are more versatile, offering various discounts like percentage off, fixed amount off, or free shipping, applied to the entire cart based on different conditions. This allows for a broader range of promotional strategies and customer incentives.

2. Can I combine Buy X Get Y Free with other promotions?

Yes, you can combine “Buy X Get Y Free” with other promotions in Magento 2. However, the order of rule processing matters. Magento applies Cart Price Rules based on their priority, so combining promotions can be unpredictable if not managed carefully. To avoid conflicts, test different combinations thoroughly before launching. Also, use clear messaging to explain the promotions to customers and prevent confusion.

3. How to handle out-of-stock products in a Buy X Get Y Free promotion?

Magento typically handles out-of-stock products based on your inventory settings. If a product required for the Buy X Get Y Free promotion becomes unavailable, the discount might not apply correctly. To prevent issues, consider implementing additional logic or using extensions that specifically address out-of-stock scenarios within promotions.

4. Why isn’t my Buy X Get Y Free promotion working?

Several issues could prevent your Buy X Get Y Free promotion from working. Common problems include incorrect rule conditions, actions, or priorities. Out-of-stock products or conflicts with other promotions can also interfere. To isolate the problem, double-check your rule settings, test the promotion thoroughly with different scenarios, and ensure product availability.

5. How to optimize the performance of Buy X Get Y Free promotions?

To optimize Buy X Get Y Free promotions, focus on simplifying rule conditions and limiting the number of products involved. Utilize Magento’s indexing and caching features to improve performance. Avoid overly complex rule setups as they can impact system speed. Regularly review and test your promotions to identify and address any performance bottlenecks.

Final words

Buy X Get Y Free is a popular marketing strategy in e-commerce, which can help stores to promote certain items and boost sales in a short period of time. The default Magento 2 also supports this feature, so you can follow the above instructions to create one. But if you want to create other promotions, why not try our Special Promotions extension? We are always ready to help if you still have any doubts, so feel free to contact us.

Related topics

Image Description
With over a decade of experience crafting innovative tech solutions for ecommerce businesses built on Magento, Jacker is the mastermind behind our secure and well-functioned extensions. With his expertise in building user-friendly interfaces and robust back-end systems, Mageplaza was able to deliver exceptional Magento solutions and services for over 122K+ customers around the world.

Looking for
Customization & Development Services?

8+ years of experiences in e-commerce & Magento has prepared us for any challenges, so that we can lead you to your success.

Get free consultant
development service
x

    Explore Our Products:

    People also searched for

    Subscribe

    Stay in the know

    Get special offers on the latest news from Mageplaza.

    Earn $10 in reward now!

    Earn $10 in reward now!

    comment
    iphone
    go up