Creating Purchase X Receive Y Free

In this topic, we will learn about how to create a Purchase Product A Receive Product B Free discount for products.

What is Purchase X Receive Y Free?

When a user adds specified quantities a product to the cart receives specified numbers of that product or another product with free price or with specified discount.

  • Browse to, WordPress admin dashboard.
  • Go to WC Conditions » WC Conditions.

  1. Click on Pricing tab to view its content.
  2. Click on Add New button to add a new Pricing Rule.

  1. Set a name for your Purchase Pricing Rule.
  2. Select Purchase x Receive y for Mode.
  3. Purchase Quantity Based On indicates that how purchased items quantities in the cart will be calculated.
    • Single product: Quantity is calculated separately for each product.
    • Single product variation: Quantity is calculated separately for each product variation, for simple products quantity will be calculated based on the product.
    • Cart line item: Quantity is calculated separately for each product line in the cart.
    • Sum of categories quantities: Quantity is calculated separately for each category in the cart.
    • Sum of all products quantities: Quantity is calculated based on the sum of all quantities in the cart.
  4. Receive Quantity Based On indicates that how products quantities that receive this discount will be calculated in the cart.
    • Single product: Quantity is calculated separately for each product.
    • Single product variation: Quantity is calculated separately for each product variation, for simple products quantity will be calculated based on the product.
    • Cart line item: Quantity is calculated separately for each product line in the cart.
    • Sum of categories quantities: Quantity is calculated separately for each category in the cart.
    • Sum of all products quantities: Quantity is calculated based on the sum of all quantities in the cart.
  5. Purchased Products Message This message will be shown in products pages that user should buy them to get this discount.
  6. Receive Products Message This message will be shown in products pages that will receive this discount.

Because our purchased product is same as receive product we only setting message for Purchased Products Message.

  1. Repeat means that this discount will be applied more than once when possible. For example in this example Buy 3 Get 1 Free if the user bought 6 quantities of purchase products and repeat is enabled he will get 2 products free, but when the repeat is disabled he will get only 1 product free.
  2. In this table, you can set purchase rule like purchase and receive quantity and discount type and discount amount.
  3. Set how many quantities of purchase products should user buys to get this discount.
  4. Set how many quantities of receive products will be discounted for the user.
  5. Set discount type.
    • Percentage discount : Applies percentage of product price as discount.
    • Price discount : Applies a price as discount to product price.
    • Fixed price: Changes product price to specified value.
  6. Set discount amount.
  7. By Add New Purchased Item you can add products to the list that user should buy them to get this discount, refer to Adding Products for more information.
  8. Select products that user should buy them to get this discount we chose Happy Ninja #37.
  9. Click on Add button to add selected products to Purchased Items list.
  10. By Add New Discounted Item you can add products to the list that this discount will apply to their price, refer to Adding Products for more information.
  11. Select products that will receive this discount we chose Happy Ninja #37.
  12. Click on Add button to add selected products to Discounted Items list.
  13. By Add New Date Time you can add Date Time Conditions to your Pricing Rule. For example, you can apply this discount to the product in specific days of the year by using Specific Date, refer to Adding Date Time Conditions for more information.
  14. By Add New Condition you can add Conditions to your Pricing Rule. For example, you can apply this discount to the product for specific users or roles and etc, refer to Adding Conditions for more information.
  15. Purchased Items lists products that user should buy them to get this discount.
  16. You can see selected products here that you add them in step 16.
  17. Discounted Items lists products that will receive this discount.
  18. You can see selected products here that you add them in step 19.
  19. Date Time lists date time conditions that you set for this Pricing Rule via Add New Date Time.
  20. Conditions lists conditions that you set for this Pricing Rule.
  21. Click on Save button to saving this Pricing Rule.

Now because we chose Happy Ninja #37 in our discount we are going to opening its page.

  1. Now we can see Purchased Products Message that informs the user about the discount.
  2. We are going to add 6 quantities of this product to see the result.

  1. As you can see in above image product price discounted to $12.00 and the total price is $72.00, in other words, the user pays 4 quantities price 18 * 4 = 72 and gets 2 products with a free price.

Settings of Product Pricing

Important: Refer to Settings of product pricing for more information.