Skip to main content
Discount based on Specific Attribute

Learn how to provide specific Attribute-based discounts using Discount Rules for Woocommerce plugin in a few straightforward steps.

Ramesh avatar
Written by Ramesh
Updated over 9 months ago

Introduction:

An attribute-based discount is a promotion that offers a discount on products with specific characteristics. Attributes are additional details or features assigned to products, such as size, color, material, or any other distinguishing factor.

For example, a store might offer a discount on red-colored shoes or provide a special price for large-sized T-shirts.

The Discount Rules for WooCommerce plugin allows businesses to target customers with specific product preferences or needs by tailoring discounts to specific attributes, they can attract customers seeking those attributes and motivate them to make a purchase.

The right way of using attributes in your products are:

Step 1: Pre-define the Attributes

VERY VERY IMPORTANT: When you create a variable product, always pre-define the Attributes in the Wordpress backend -> Products -> Attributes section

Step 2:

Then, when you create the Variable product, choose these attributes, and add.

Step 3:

Now associate the attribute values and check the "Used for variations" checkbox.

IMPORTANT: Please DO NOT select the "custom product attribute".

If you use "Custom Product Attributes" that is created on-the-fly, then the attribute specific discount will NOT apply. Because WooCommerce does not create any attributes when you use a custom product attribute.

Now, let's explore the process of creating attribute-based discounts using the Discount Rules for WooCommerce plugin.

Example scenarios:

  • Get a 10% discount on all “M-sized” Hoodies throughout the store.

  • Get a free product “Jeans” on purchase of "Red-color” T-shirt.

  • Buy any “XL-sized” attribute, get 50% off on “M-sized” attribute (Advanced Scenario)

To create rules with the filter “Attributes”, you need to have the Discount Rules PRO plugin installed and activated. Purchase the PRO version by clicking on the button below.

Now, let's explore each example scenario in detail.

Example 1: Get a 10% discount on all M-sized Hoodies throughout the store.

In this particular situation, customers will be granted a 10% discount on their entire purchase when they buy M-sized Hoodies across the entire store.

To create this rule, follow these steps

Creating a Discount Rule:

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

  • Select the discount types as “Product Adjustment”

Then configure the discount rule as seen in the below screenshot:

Details of configurations are:

  • Choose "Attributes” from the filter options and type a few characters of the attributes name to find and select it. You also have options like specific Categories, selected Products, Sku’s, brands and so on… You can choose the option depending upon your requirement.

  • Set the discount type to a 10% Percentage Discount. You also have options to choose Fixed discount or Fixed price per item

  • Click on “SAVE” once we have successfully created the rule.

Customers who buy any product with the attribute "M" will be eligible for a 10% discount on the product with “M” attribute.

Screenshot showing 10% off applied on the attribute “M” :

Example 2: Get a free product “Jeans” on purchase of "Red-color” T-shirt

In this scenario, customers will receive a product “Jeans” as Free when they make a purchase of a T-shirt with the attribute "Red-color" in your store. This offer encourages customers to choose and buy the specified attribute “Red-color” and rewards them with an additional item, enhancing their shopping experience.

To create this rule, follow these steps

Creating a Discount Rule:

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

  • Select the discount types as “Buy X get Y”

Then configure the discount rule as seen in the below screenshot:

Details of configurations are:

Step 1: Choose "Attributes” from the filter options (buy X section) and type a few characters of the attributes name to find and select it. You also have options like specific Categories, selected Products, Sku’s, brands and so on… You can choose the option depending upon your requirement.

Step 2: Choose “Buy X get Y - Products” in the Discount/ Get Y section and inlist the product “Jeans” as free. You also have other options like “Buy X Get Y - All” or “Buy X Get Y - Categories'' depending on your requirement.

Step 3: Choose how to count the quantities as -> Filter set above (count all quantities in cart as together. For example, if a customer buys 2 of Product A and 3 of Product B, our plugin count 5 products as together)

Step 4: Select the mode of application as

  • Autoadd

  • Set minimum quantity as 1, leave maximum quantity section as empty and set free quantity as 1

  • Choose the discount type as FREE (you can also set Percentage or Fixed Discount) and

Step 5: Save the rule.

Now, a “Jean” product will get auto added as free for customers whose purchase any products in store with the attribute “Red”

Here is the cart page screenshot showing an example:

Advanced Scenario

Example 3: Buy any “XL-sized” attribute, get 50% off on “M-sized” attribute

In this example, customers who buy the XL-sized attribute of any product will get 50% off on their M-sized attribute and for this scenario we have to choose the Buy X Get Y rule.

This type of scenario is an advanced one and in order to achieve this, we can load the attributes in (Get Y/ Discount section) using the addon “Collections”

Step 1: Creating a collection for the “M” size attribute

  • Go to WordPress dashboard -> Woocommerce -> Discount Rules -> Click on the Collections tab

  • Click on the button “Add New Collection”

Then configure the collection as seen in the below screenshot:

Details of configurations are:

  • Give a title for the collection “M size attribute”

  • Then choose the filter type as “Attributes” and select the attribute “M” size by typing a few characters of the attribute. You also have options like specific Categories, selected Products, Sku’s, brands and so on… You can choose the option depending upon your requirement.

  • Click on ‘Save” once we have successfully created the collection.

Step 2: Creating a Discount Rule:

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

  • Select the discount types as “Buy X Get Y”

Then configure the discount rule as seen in the below screenshot:

Details of configurations are:

Step 1: Choose "Attributes” from the filter options (buy X section) and type a few characters of the attributes name to find and select it. You also have options like specific Categories, selected Products, Sku’s, brands and so on… You can choose the option depending upon your requirement.

Step 2: Choose “Buy X get Y - Collections” in the Discount/ Get Y section and inlist the attribute “M” by typing a few characters of the collection title we have created above. You also have other options like “Buy X Get Y - All”, “Buy X Get Y - Products” or “Buy X Get Y - Categories” depending on your requirement.

Step 3: Choose how to count the quantities as -> Filter set above (count all quantities in cart as together. For example, if a customer buys 2 of Product A and 3 of Product B, our plugin count 5 products as together)

Step 4: Select the mode of application as

  • Cheapest

  • Set minimum quantity as 1, free quantity as 1 and enable the “Recursive” checkbox

  • Choose the discount type as Percentage discount and set the value as 50 (you can also set Free or Fixed Discount) and

Step 5: Save the rule.

If customers purchase any product with the attribute "XL", they will receive a 50% discount on any product with the attribute "M" recursively.

Here is the cart page screenshot showing an example:

The above discussed scenarios require a PRO version.

Note :

The same approach can be adopted for other Buy One get One based Attribute Discount Rules as well.

Next Steps:

You may also want to check out these helpful guides:

Refer this video to know more about attribute based scenarios:

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?