View Product Page

How to configure rules for user roles

In this post, we’ll explore how to create a rule to assign a new role automatically when meeting specific conditions. In our example, we want to reward users with the Partner role that provides exclusive benefits for making big purchases.

Let’s begin:

Step 1 — Add rule

From the Rules tab in the plugin settings, click on the “Add rule” button to start configuring our rule (1)

Add rule

And add a name to identify the rule (2)

Add rule name

Step 2  User role assignment

Next, choose the role assignment type. In this case, we want to assign a new role, so we select ‘the user will gain the role’ and then choose the role to be assigned from the dropdown (3).

Set user role assignment

Step 3 — Rule conditions

Now, let’s define the conditions for role assignment. The rule should apply when the order total falls within a specific price range. Set the minimum amount to 5000, and leave the “To” field empty to allow for unlimited order totals. (4)

Set rule conditions

Step 4 – Schedule rule

Additionally, we need the rule to take effect from a specific date, so we set a start date accordingly and leave the end date blank to keep the rule active indefinitely (5).

Schedule rule

Step 5  Enable role expiration

Since we want this role to expire after a specific number of days, we have to enable the role expiration option, selecting the role to be switched back in 30 days (6). In this way, users will have to keep purchasing orders within the minimum price range to maintain the role and it’s benefits

Enable role expiration

Step 6 – Exclude users

Lastly, to prevent users with the “Reseller” role from benefiting from this rule, we enable the exclude users option (7).

Exclude users

Don’t forget to click ‘Save’ and we will have our new role-switching rule created!