Creating Purchase Product A Receive Product B Discounted

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

What is Purchase Product A Receive Product B With Discount?

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

In this example, we are going to set 50% discount on Posters category products when users buy 2 products of Clothing category products. In other words, Buy 2 Items of clothing to Get 1 Poster with 50% 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. Because we want to user buys Clothing category products we choose Sum of categories quantities as Purchase Quantity Based On in other words we want to count the number of Clothings category products 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.
  4. Receive Quantity Based On indicates that how products quantities that receive this discount will be calculated in the cart. Because we want to apply the discount on Posters products we choose Sum of categories quantities as Purchase Quantity Based On in other words we are applying this discount to a category products price.
    • 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.

In this example, this message will be shown in Clothing category products page.

  1. Receive Products Message This message will be shown in products pages that will receive this discount.

In this example, this message will be shown in Posters category products page.

  1. Repeat means that this discount will be applied more than once when possible. For example, in this example, Buy 2 Items of clothing to Get 1 Poster with 50% discount if the user bought 6 quantities of Clothing and repeat is enabled he will get 3 posters with 50% discount, but when the repeat is disabled he will get only 1 poster with 50% discount.
  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. We set 2 because the user should buy 2 Items of clothing.
  4. Set how many quantities of receive products will be discounted for the user. We set 1 because the user gets 1 poster with 50% discount per 2 bought Clothing.
  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. Because we want to sell Clothing category products we select Categories in the list.
  9. We chose Clothing category products.
  10. Click on Add button to add it to Purchased Items.
  11. 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.
  12. Because we want to apply the discount on Posters category products we select Categories in the list.
  13. We chose Poster category products.
  14. Click on Add button to add it to Discounted Items.
  15. 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 option, refer to Adding Date Time Conditions for more information.
  16. 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.
  17. Purchased Items lists products that user should buy them to get this discount.
  18. You can see Clothing category here that selected in step 17.
  19. Discounted Items lists products that will receive this discount.
  20. You can see Posters category here that selected in step 21.
  21. Date Time lists date time conditions that you set for this Pricing Rule via Add New Date Time.
  22. Conditions lists conditions that you set for this Pricing Rule.
  23. Click on Save button to saving this Pricing Rule.

Please note that when one of Date Time Conditions becomes true this discount will applies to the product in other words it does not checks all of listed Date Time Conditions and when one of these conditions becomes true discount will applies.

Please note that when all of listed Conditions becomes true this discount will applies to the product otherwise it will not applies.

Now we are going to a Clothing product page to see it’s information message to the user.

  1. As you can see it shows the message that set in step 7.
  2. We are going two add two quantities of this product to the cart.

Now we are going to opening a Poster product page.

  1. As you can see it shows the message that set in step 8.
  2. We are going two add one quantity of this product to the cart.

  1. As you can see poster product gets 50% discount on the price.

Another example :

  1. User added 4 Items of clothing to the cart.
  2. User added 3 Posters to the cart.
  3. The user gets 2 Posters with 50% discount 1 Poster per 2 Items of clothing. Please note that one of Premium Quality poster gets 50% discount.

Settings of Product Pricing

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