WooCommerce User Role Discounts

WooCommerce User Role Discounts: A Step-by-Step Guide

The success of an online store heavily depends on loyal returning customers. These customers yield the majority of a store’s revenues.

65% of an online store’s earnings come from returning loyal customers. The chance of selling a product to an existing customer is 60-70%, while for new customers, it is only 5-20%.

So, what is the top factor in making and keeping a customer loyal?

Product Price. 62% of customers say that price is the top factor for them to stay loyal to a brand.

Therefore, to survive in today’s immensely competitive marketplace, you need to come up with a sustainable pricing strategy. One sure shot of a pricing strategy is a user role-based discount pricing.

And the best platform for this is WooCommerce.

In this article, we will find out what WooCommerce user role discount pricing is and how to set up WooCommerce user role discount in detail.

Let’s dive in.

What is WooCommerce User Role Discount?

User role discount for WooCommerce are a pricing strategy that allows online store owners to offer different prices to customers based on their assigned user role. In platforms like WooCommerce, user roles can be defined as customer, wholesale, affiliate, or any custom role you create.

You may also create a subscription-based WooCommerce membership website or run loyalty programs in your store and reward your loyal customers based on their user roles. You can tailor your pricing to different customer segments by assigning specific discounts to these roles.

In today’s competitive marketplace, a one-size-fits-all pricing approach is often ineffective. Targeted pricing strategies, such as WooCommerce discount based on user role, enable you to optimize revenue and customer satisfaction.

By understanding different customer groups’ unique needs and preferences, you can offer tailored pricing that maximizes value for both the customer and your business.

How to Setup WooCommerce User Role Discount

The core WooCommerce doesn’t offer many discount features except the coupon tool. The coupon tool does let you create coupon discounts based on the user’s email address, which can be useful for offering customer-specific discounts.

However, that doesn’t truly facilitate WooCommerce user role discount.

There are two ways you can generate WooCommerce discounts for user roles.

  1. Custom Code
  2. Discount Plugin

Let’s first explore how to create WooCommerce user role-based discounts using custom codes.

Setup WooCommerce User Role Discount Using Custom Codes

Suppose you have a loyalty program and divided your customers into different membership plans such as Gold, Silver, Platinum, etc. Let’s say you want to reward your Silver members with a 10% discount, Gold members with a 20% and Platinum members with a 30% discount on any purchases.

To achieve this, you need to go through the following steps.

Step 1: Set Up User Roles

First, ensure your customers are assigned to the appropriate user roles (Silver, Gold, Platinum). You can easily create membership plans and user roles if you have a membership website. Alternatively, you can use a plugin such as “User Role Editor” to create and manage these roles.

Step 2: Backup Your Site / Create a Child Theme

Playing with codes always has the risk of breaking your site or certain features not working. You can create a separate child theme to insert custom codes to save your running store from breakdowns.

If you are not familiar with child themes and want to directly add codes to your core theme file, you must backup your entire website.

Step 3: Add Custom Code to Your Theme’s functions.php File

We will directly edit the theme file instead of editing a child theme. Go to Appearance >> Theme Editor.

theme file editor

Click on the functions.php and scroll to the bottom. Hit enter to create some empty spaces for your codes.

functions php

Add the following code to your theme’s functions.php file. This code will apply a WooCommerce discount per user role.

// Apply discount based on user role

add_action('woocommerce_cart_calculate_fees', 'apply_membership_discounts', 20, 1);

function apply_membership_discounts($cart) {

if (is_admin() && !defined('DOING_AJAX')) return;

$user = wp_get_current_user();

// Check if the user is logged in and has one of the membership roles

if (in_array('silver', (array) $user->roles)) {

     $discount = $cart->subtotal * 0.10; // 10% discount for Silver members

     $cart->add_fee('Silver Member Discount', -$discount);

} elseif (in_array('gold', (array) $user->roles)) {

     $discount = $cart->subtotal * 0.20; // 20% discount for Gold members

     $cart->add_fee('Gold Member Discount', -$discount);

} elseif (in_array('platinum', (array) $user->roles)) {

     $discount = $cart->subtotal * 0.30; // 30% discount for Platinum members

     $cart->add_fee('Platinum Member Discount', -$discount);

}

}
Code Explanation
  • Hook: The code hooks into woocommerce_cart_calculate_fees to apply the discount when the cart totals are calculated.
  • Role Check: It checks the current user’s roles against the defined roles (‘silver’, ‘gold’, ‘platinum’).
  • Discount Calculation: Depending on the user’s role, it calculates a discount as a percentage of the cart subtotal.
  • Add Fee: It applies the discount as a negative fee, which WooCommerce interprets as a discount.

Step 4: Test the Discounts:

You can create some demo customers and assign them your new user roles.

gold member

Log in as a user with each role (Silver, Gold, Platinum). Let’s start with a Silver customer.

log in

Add some products and jump to the cart page.

WooCommerce user role discount

As you can see, the system applied a 10% WooCommerce user role discount as per our set code. Let’s log in to a Gold member’s account and add some products.

Here’s how the cart page displays the WooCommerce discount by user role.

WooCommerce user role discount

Repeat the process for a Platinum member and check the result.

WooCommerce user role discount

Setup WooCommerce User Role Discount Using a Plugin

Using codes has more disadvantages than benefits, and we vote against it. The easiest and best option for creating a WooCommerce user role pricing is to use a plugin.

There are a large number of discount plugins available for you in the market, both paid and free. The best WooCommerce user role based discount plugin we will use today is called Disco – Dynamic Discount Plugin for WooCommerce.

Disco discount plugin

We have tested several discount plugins, including premium ones, for writing a wide range of discount-related articles in our blog. And we can safely say that this free plugin beats all of them by a big margin.

It has all the premium features you only find in a paid plugin—and, of course, for absolutely free! Whether you are looking to create complex conditional discounts, bundle discounts, or lucrative BOGO deals, this plugin packs it all.

Creating WooCommerce User Role Discount Using Disco

Install and activate the plugin from the WordPress repository.

install WooCommerce user role discount plugin

It will create a Disco menu in the admin panel. Click on it.

create campaign

Let’s create a WooCommerce user role discount campaign. Click the Create a Discount button.

WooCommerce user role discount campaign

First, name your campaign and select the Discount Intention. We will go with the Product one.

Campaign name

We want to offer this discount for all products.

all products

Select your discount type from the Product Rules tab and enter your value.

set percentage

The Conditions tab is the treasure trove that lets you generate a plethora of discount types. Hit the button to get started.

add conditions

For this article, we will need the User Role option. Scroll down the Filter field to find and select it.

select user role for WooCommerce user role discount

Scroll and select your User Role, or type it and hit enter.

select user role

Here’s what WooCommerce user role discount you have set up.

user role setup

Save the discount campaign. Log in as a demo Silver member from a different browser and check if this discount rule works.

WooCommerce user role discount

As you can see, the cart page automatically applies discounts to the added products. For other user roles, you need to create separate discount campaigns following the above steps.

You can also quickly duplicate an existing discount campaign from the Disco campaign list.

duplicate WooCommerce user role discount

After that, edit the necessary fields.

setup WooCommerce user role discount

You can also apply multiple conditions to a discount campaign to further personalize it. For example, let’s say you want to offer a 20% discount to Gold members only when their cart total is over $200.

Add another condition and scroll to the Cart section. Select the Cart Subtotal option.

cart subtotal

Set the relation of the condition with the primary user role condition and set the equation.

set equation

Here’s the final setup.

multiple condition for WooCommerce user role discount

Now, if you check from a Gold member account, the discount will only apply when the two conditions are met.

Benefits of Implementing User Role Discounts in WooCommerce

WooCommerce user role discount can be a powerful tool for enhancing your WooCommerce store’s revenue, customer satisfaction, and overall business performance.

Here’s a detailed breakdown of the benefits:

Enhanced Revenue Generation

  • Increased Average Order Value: You can incentivize customers to purchase more items per order by offering exclusive discounts to specific customer segments. This will lead to increased revenue. For example, offering a percentage discount to wholesale customers can encourage larger order quantities.  
  • Expanded Customer Base: Implementing tiered pricing structures can attract new customer segments. For instance, offering student discounts can entice a younger demographic to purchase your products.
  • Optimized Pricing: By tailoring prices to different customer segments, you can maximize revenue potential by charging premium prices to customers with higher purchasing power while offering discounts to price-sensitive segments.

Improved Customer Satisfaction and Loyalty

  • Personalized Shopping Experience: Offering discounts based on user roles creates a sense of exclusivity and personalization. As a result, this can enhance the overall customer experience.  
  • Increased Customer Loyalty: Rewarding loyal customers with exclusive discounts strengthens their relationship with your brand and encourages repeat business. For instance, offering loyalty discounts to returning customers can foster long-term customer relationships.  
  • Effective Customer Retention: By providing value through discounts, you can reduce customer churn and maintain a steady customer base.  

Effective Customer Segmentation

  • Targeted Marketing: User role discounts allow you to divide your customer base into distinct segments, which enables targeted marketing campaigns and promotions. For example, offering exclusive product recommendations to specific user roles can increase sales.  
  • Data-Driven Decision Making: By analyzing purchase behavior and preferences of different user roles, you can make data-driven decisions to optimize your product offerings and marketing strategies.
  • Enhanced Customer Understanding: Understanding the needs and preferences of different customer segments helps you tailor your products and services to meet their specific requirements.

Optimized Profitability

  • Improved Profit Margins: By carefully structuring discounts and optimizing pricing for different customer segments, you can increase your profit margins. For example, offering higher discounts to bulk buyers can reduce inventory holding costs and improve profitability.
  • Efficient Inventory Management: User role discounts can help you manage inventory levels effectively by encouraging sales of specific products to particular customer groups.
  • Resource Optimization: By understanding customer purchasing patterns, you can optimize resource allocation and reduce costs associated with overstocking or understocking.

Competitive Advantage

  • Differentiation: Offering unique pricing structures based on user roles can set your business apart from competitors and attract new customers.
  • Market Penetration: By providing tailored pricing options, you can expand your market reach and capture a larger share of the target audience.
  • Brand Building: Implementing a well-structured user role discount program can enhance your brand image and reputation as a customer-centric business.

Wrap up

By effectively implementing a WooCommerce user role discount, you can significantly enhance your WooCommerce store’s performance and achieve long-term success.

We hope this article will help you efficiently set up user role discounts at your store. Let us know if you need any help setting up any discount rules.

FAQ (Frequently Asked Questions)

How can I set discounts for specific user roles in WooCommerce?


Using custom codes or a discount plugin, you can set discounts for specific user roles, such as subscribers, customers, wholesale customers, or specific membership plan holders. A highly recommended free plugin is Disco – Dynamic Discount Plugin for WooCommerce.

Is there a way to offer different prices to different user roles in WooCommerce?


First, you need to create different user roles as per your requirements. You can do so by using a plugin such as User Role Editor or setting up a WooCommerce membership website. To set up a WooCommerce user role discount, you can use the free plugin called Disco.

Can I offer store-wide or product-specific discounts based on user roles in WooCommerce?


The core WooCommerce plugin doesn’t offer any advanced discount tools. However, you can apply custom codes or use a discount plugin to offer store-wide or product-specific discounts based on user roles. We highly recommend the Disco discount plugin, which packs all possible discount features for absolutely free.

Leave a Reply

Your email address will not be published. Required fields are marked *


This site uses Akismet to reduce spam. Learn how your comment data is processed.

6,321,244+ Downloads. 635+ plus 5-star ratings. Promote products on any platform you want.