Person using laptop on computer table

Using dynamic pricing with WooCommerce memberships

CommerceCategory
3 min read
Beka Rice

WooCommerce Memberships has the ability to provide discounts for members. This is a popular way to provide perks or wholesale pricing for certain groups of customers.

However, Memberships does not have complex sets of rules for for pricing, such as the ability to set discounts at tiers for membership products. You can use Dynamic Pricing for this sort of set up, as it lets you add pricing rules based on role, quantity tiers, and more. There’s just one problem: Dynamic Pricing doesn’t recognize membership types for its discount rules.

This is a good use case for our free Role Handler plugin for Memberships. This plugin lets you change the role a member has on your site while they possess an active membership; that role can then be changed when the member becomes inactive. This gives you a way to bridge compatibility between plugins that support roles, but not Memberships.

Configure roles for members

The first step is to create a role I’ll use exclusively for active members. In this example, I’ve added a “Member” role using the free User Role Editor plugin. I’ve cloned the “Customer” role to create this role, so it’s functionally no different than other customers.

However, I can now use this with my Role Handler plugin. Under WooCommerce > Settings > Memberships > General, I can update settings to use the “Member” role for active members, and revert back to “Customer” for inactive members.

WooCommerce Memberships Role Handler Settings

Now when a member becomes active, they’ll switch to the “Member” role, and then when they become inactive, they switch to the “Customer” role.

This will not apply to members that already exist. You’d need to either mark them paused, then reactive the memberships, or manually update your existing members’ user roles.

Configure dynamic pricing

From here, I can now configure Dynamic Pricing to work with my custom role for members. I could do something pretty general like adding an overall discount for members with my “Member” role under WooCommerce > Dynamic Pricing.

Memberships role-based dynamic discount

However, this isn’t too useful to us, given Memberships can do this already easily as a discount rule. The real power of this integration lies in the product pricing rules. Now, I can create tiered discount rules or promotional rules that only relate to the member role on my site.

For example, let’s provide a discount for members when they purchase a minimum quantity of a given item.

Memberships product dynamic pricing

When a non-member adds a quantity within this range, they won’t see a discount available from Dynamic Pricing:

WooCommerce Memberships Dynamic Pricing non-member view

However, if an active member does the same thing, they’ll have the “Member” role, and will now see that discount available on the item:

WooCommerce Memberships Dynamic Pricing member view

The Role Handler plugin gives you a simple way to bridge the gap between Memberships and other WordPress plugins or WooCommerce extensions that rely on roles, connecting them to your active members.