Description
Coupons by Role plugin allows administrators to hide coupon field and button from the Woocommerce cart page for each group/role and optionally show text instead. This plugin is useful when you use role based pricing plugins since they do not discount prices with woocommerce functions and in those cases Woocommerce allows double discount where role based price and coupon can be stacked.
Supports classic WooCommerce cart and checkout templates and the Cart and Checkout blocks. Restricted roles cannot apply coupons through the Store API. Messages are displayed as plain text. For users with multiple restricted roles, the first restricted role in their role list determines the message.
Installation
- Upload the plugin folder to the
/wp-content/plugins/directory - Activate the plugin through the ‘Plugins’ menu in WordPress
- The plugin settings can be accessed via the ‘Woocommerce’, ‘Settings’ menu and “Coupons by Role” tab in the administration area (either your site administration for single-site installs, or your network administration for network installs).
Reviews
There are no reviews for this plugin.
Contributors & Developers
“Coupons by Role” is open source software. The following people have contributed to this plugin.
ContributorsTranslate “Coupons by Role” into your language.
Interested in development?
Browse the code, check out the SVN repository, or subscribe to the development log by RSS.
Changelog
1.3.0
- Added missing License and License URI metadata matching the existing GPLv3-or-later license.
- Added WooCommerce Cart and Checkout block support, including hidden coupon forms and optional role messages.
- Enforced coupon restrictions during Store API and AJAX requests, including direct coupon applications, while preserving ordinary administration tools.
- Fixed classic cart message placement and retained messages after cart updates without relying on submit-button selectors or jQuery.
- Fixed message selection for users with multiple roles by using the first restricted role in their role list.
- Rendered messages as escaped plain text and removed inline JavaScript to safely handle quotes, line breaks, and HTML.
- Ignored empty or malformed messages and malformed role settings.
- Deferred translation loading to init and made role message labels translatable.
- Improved role lookup while retaining compatibility with the declared minimum WordPress version.
- Declared WooCommerce as a plugin dependency and declared Cart and Checkout block compatibility.
- Updated Tested up to to WordPress 7.1.2.
- Added 26 regression checks, verified using PHP 8.5.11 and WordPress 7.1.2 hooks and escaping functions.
1.2.1
- Version bump and tested up-to data.
1.2
- Version bump and tested up-to data.
1.1
- Fixed plugin layout and descriptions.
1.0
- Initial release

