WordPress plugin intelligence profile

Coupons Role Restriction for WooCommerce

Restrict the usage of WooCommerce coupons based on user roles.

WP PlugIndex snapshot

Current directory snapshot

Tested up to WordPress 6.9
Current version1.1.3
WordPress coverageTested up to WordPress 6.9
Minimum stackWP 6.4 · PHP 7.4
Directory statusactive
Last directory update7 Jan 20269mo ago
Active installations60Adoption metric — not a quality score
WordPress.org ratingNo WordPress.org ratings yet
Official packageDirect from WordPress.org

Repository metrics are context, not quality scores. Active installations measure adoption and can strongly reflect a plugin’s age and historical popularity. Ratings, recent updates and “Tested up to” metadata also do not guarantee modern code, error-free operation, security, feature completeness or suitability for a particular site. Why active installs don’t tell the whole story →

WP PlugIndex currently records Coupons Role Restriction for WooCommerce version 1.1.3 as active, updated 9mo ago and tested up to WordPress 6.9.

Overview

About this plugin

This plugin allows you to restrict the usage of WooCommerce coupons based on user roles, including guest users.

You can specify which roles (including guests) are allowed or excluded from using a coupon, providing more control over your discount strategies.

Features

  • Restrict coupon usage based on user roles.
  • Option to specify both allowed and excluded roles.
  • Support for guest users with a “Customer Is A Guest” pseudo-role.
  • Customize the error message via a filter.

Filters

runthings_wc_coupons_role_restrict_error_message

This filter allows customization of the error message shown when a coupon is not valid for the user’s account type.

For detailed documentation and advanced examples, see the full documentation on GitHub.

Parameters:

  • $message ( string ): The default error message, e.g., "Sorry, this coupon is not valid for your account type.".
  • $context ( array ): Additional context for the error, including the coupon, user roles, and guest status.

$context object format:

The $context array contains the following keys:

– coupon ( WC_Coupon ): The coupon object being validated.

– is_guest ( bool ): Whether the current user is a guest (not logged in).

– user ( WP_User ): The current user object. For guests, this will be an empty user object.

– allowed_roles ( array ): Roles explicitly allowed to use the coupon, in the format [role_id => role_name].

– excluded_roles ( array ): Roles explicitly excluded from using the coupon, in the format [role_id => role_name].

– effective_allowed_roles ( array ): The final calculated roles allowed to use the coupon, after considering exclusions, in the format [role_id => role_name]. This is the set of roles that can use the coupon.

License

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

html.

0)

0)

WordPress.org metadata

Plugin tags

Topics listed for this plugin in the WordPress.org directory.

  • role restriction
  • user roles
  • coupons
  • discount
  • woocommerce
Compatibility & maintenance

Compatibility & maintenance

Tested up to WordPress 6.9

Not yet marked as tested with WordPress 7.1. WordPress.org currently lists Tested up to 6.9.

Current WordPress releaseWordPress 7.1
WordPress.org Tested up to6.9
Minimum requirementsWordPress 6.4 · PHP 7.4
Update activity7 Jan 20269mo ago

“Tested up to” is directory metadata supplied by the plugin author. WP PlugIndex does not turn an older declaration into a claim that the plugin is incompatible.

Changes recorded by WP PlugIndex

Recent tracked changes

No tracked version or compatibility changes have been recorded by WP PlugIndex yet.

Tracking & source

WP PlugIndex tracks public WordPress.org directory metadata and records selected version, compatibility and availability changes as they are detected.

Plugin watchlist

Watch this plugin

Sign in to your WP PlugIndex account or create a free account. Free accounts can watch up to 5 plugins and see what changed.

Watch limit

Watchlist limit reached

You have reached your current active watch limit.