When a user holds more than one role, Coupon by User Role for WooCommerce applies a disable or invalidate rule only if the user has a targeted role and none of the roles in the matching Exceptions field. An exception role always wins. Set exceptions at WPFactory > Coupon by User Role, in the Availability section.
The matching rule #
A disable or invalidate rule applies to a customer when both of these are true:
- The customer has at least one of the roles you selected, and
- The customer has none of the roles in the matching Exceptions field.
In other words, an exception role always wins. If a user has both a targeted role and an exception role, the rule skips them.
A worked example #
Say you invalidate all coupons for the Customer role, but one of your customers is also a Shop manager who should keep full access. Add Shop manager to the Exceptions field next to the invalidate list. Now:
- A plain customer is invalidated (has Customer, no exception role).
- A customer who is also a shop manager is allowed (has the exception role).
Where the exceptions fields are #
- Go to WPFactory > Coupon by User Role (also reachable at WooCommerce > Settings > Coupon by User Role).
- Open the Availability section. Each of Disable all coupons and Invalidate all coupons has its own Exceptions field directly beneath it.
- For a single coupon, the Invalidate by user role tab on the coupon has its own Exceptions field too.
Exceptions apply to disable and invalidate, not amounts #
The disable and invalidate rules each have exceptions. The Amount by user role feature does not use exceptions: instead, when a customer has several roles, the first role with an amount set on the coupon is used. Plan overlapping roles accordingly.
Troubleshooting #
- An exception is not working. Confirm the user actually holds the exception role (check their profile under Users), and that you added the role to the exceptions field beside the correct rule.
- Everyone is exempt. Check you did not add the same role to both the target list and the exceptions list.
Get more control #
Exceptions are free for the standard roles. Coupon by User Role for WooCommerce Pro lets you use custom roles as both targets and exceptions. See what Pro unlocks.