All Collections
Discount Rules for WooCommerce
Buy One get One Scenarios
Buy any item from Category A and get Discount on Category B
Buy any item from Category A and get Discount on Category B

Learn how to create “Buy a product from Category A and receive a discount on Category B” with Discount Rules for WooCommerce.

Ramesh avatar
Written by Ramesh
Updated over a week ago

Introduction :

Category-based discounts in Discount rules for WooCommerce plugin offered to customers based on the category of products they purchase. Category-based discounts can be a powerful tool for businesses to increase sales and promote specific products or categories.

This user guide explains how to implement Category-based discounts in your WooCommerce store.

The following are some of the examples for Category-based discounts,

  • Buy 1 or more items from Category A and get one of the items from Category B for free.

  • Buy 1 item from Category A and get one of the cheapest items from Category B for 20% discount, Buy 2 and get 2 for 20% discount and recursively..

  • Buy 1 item from Category A and get one of the cheapest items from Category B for a fixed discount of $100.

Before getting started, please make sure that you have installed and activated the “Discount Rules PRO'' plugin. The above scenarios require the Buy X Get Y discount type feature, which is available only in the PRO version.

Let’s get started

Example 1 : Buy 1 or more items from Category A and get one of the items from Category B for free.

This scenario lets customers buy one product from Category A and receive one of the cheapest products from Category B for free.

Creating a Discount Rule

  • Go to WordPress dashboard -> WooCommerce -> Discount Rules -> Click on “Add New Rule” button.

  • Choose “Buy X Get Y” as the Discount type.

Here is the screenshot of the rule configuration that follows,

Rule Configuration :

Filter Section

Choose "Category" in the "Filter" section (Choose Category A) as customers have discounts while buying products from the specific categories.

Discount Section

Choose “Buy X Get Y Categories” in the Discount section as the discount is for the specific category. You can also have other options depending on your requirement.

Choose how to count the quantities as -> Filter set above (count all quantities in cart as together). Select the Mode of Apply as “Cheapest” or “Highest”.

Enter the minimum quantity as “1”, maximum quantity as “999” or leave it as empty and choose a different category (Choose Category B) from the filter section for “Get Quantity” which is chosen in the filter section.

Enter the free quantity as “1” and discount type as “Free” (you can also have percentage and fixed discounts)

Once configured, save and publish the rule.

Now, when a customer adds one product from Category A and one product from Category B, the product from Category B would be free.

Here is the screenshot of the cart page showing an example:

Example 2 : Buy 1 item from Category A and get one of the cheapest items from Category B for 20% discount, Buy 2 and get 2 for 20% discount and recursively..

This scenario lets customers buy one product from Category A and receive one of the cheapest products from Category B for a 20% discount and by increasing the quantity of purchased items, the 20% discount would be given recursively…

Creating a Discount Rule

  • Go to WordPress dashboard -> WooCommerce -> Discount Rules -> Click on “Add New Rule” button.

  • Choose “Buy X Get Y” as the Discount type.

Here is the screenshot of the rule configuration that follows,

Rule Configuration :

Filter Section

Choose "Category" in the "Filter" section (Choose Category A) as customers have discounts while buying products from the specific categories.

Discount Section

Choose “Buy X Get Y Categories” in the Discount section as the discount is for the specific category. You can also have other options depending on your requirement.

Choose how to count the quantities as -> Filter set above (count all quantities in cart as together). Select the Mode of Apply as “Cheapest” or “Highest”.

Enter the minimum quantity as “1” and choose a category (Choose Category B) for “Get Quantity” which is different from the category chosen in the filter section.

Enter the free quantity as “1”, discount type as “Percentage Discount” (you can also have free and fixed discounts according to your requirements)

Enable Recursive option inorder to repeat the discounts endlessly.

Once configured, save and publish the rule.

Now, when a customer adds two products from Category A and two products from Category B, the product from Category B will get a 20% discount each.

Here is the screenshot of the cart page showing an example:

Example 3 : Buy 1 or more items from Category A and get one of the cheapest items from Category B for a fixed discount of $100.

This scenario lets customers buy one product from Category A and receive a $100 discount on one of the cheapest products from Category B.

Creating a Discount Rule

  • Go to WordPress dashboard -> WooCommerce -> Discount Rules -> Click on “Add New Rule” button.

  • Choose “Buy X Get Y” as the Discount type.

Here is the screenshot of the rule configuration that follows,

Rule Configuration :

Filter Section

Choose "Category" in the "Filter" section (Choose Category A) as customers have discounts while buying products from the specific categories.

Discount Section

Choose “Buy X Get Y Categories” in the Discount section as the discount is for the specific category. You can also have other options depending on your requirement.

Choose how to count the quantities as -> Filter set above (count all quantities in cart as together). Select the Mode of Apply as “Cheapest” or “Highest”.

Enter the minimum quantity as “1” and choose a category (Choose Category B) for “Get Quantity” which is different from the category chosen in the filter section.

Enter the free quantity as “1” and discount type as “Fixed Discount”, enter the value as “100” (you can also have free and percentage discounts according to your requirements)

Once configured, save and publish the rule.

Now, when a customer adds one product from Category A and one product from Category B, the product from Category B would get a $100 fixed discount.

Here is the screenshot of the cart page showing an example:

Above discussed scenarios will require Discount Rules PRO.

Next Steps :

You may also want to check out these helpful guides :

Refer this video to know more about different Category based discounts :

Still unclear?

If you need any assistance, please create a support request at our ticket system. We are always happy to assist you :)

Did this answer your question?