Description
Simple Role Based Pricing is a lightweight and flexible WooCommerce plugin that allows you to set custom prices or discounts for products based on user roles. Configure global pricing rules, restrict discounts to specific product categories, apply bulk actions, or set role-specific prices per product with Quick Edit support. The plugin ensures robust pricing logic with category-based restrictions and detailed debug logging for troubleshooting.
Key Features
- Role-Based Pricing: Set fixed prices, percentage discounts, or fixed-amount discounts for specific user roles.
- Category Restrictions: Apply discounts only to products in selected categories (e.g., “storage”).
- Global Rules: Define pricing rules for all products or specific categories in WooCommerce Settings.
- Bulk Editing: Adjust prices for multiple products at once.
- Quick Edit Support: Set role-based prices directly from the product list.
- Flexible Compatibility: Works with simple and variable WooCommerce products.
- Debug Logging: Detailed logs for troubleshooting pricing issues, including category matching.
Use Cases
- Offer exclusive discounts to VIP customers or wholesalers.
- Restrict discounts to specific product categories for certain roles.
- Create role-specific pricing for B2B or B2C customers.
Compatibility
- WooCommerce: Required (version 4.0 or higher recommended).
- User Role Editor: Optional, for managing custom user roles.
- Other Role Management Plugins: Compatible with plugins that add custom roles to WordPress.
- Themes: Tested with popular themes like Twenty Twenty-Five and Astra.
Configuration
- Global Rules:
- Navigate to WooCommerce > Settings > Role Based Pricing.
- Select a user role (e.g., Administrator, Customer).
- Choose whether to apply pricing to All Products or Specific Categories.
- Set the discount type (Percentage, Fixed Amount, or Fixed Price) and value.
- Save changes to apply the rules site-wide.
- Category Restrictions:
- Select Specific Categories and choose the desired product categories (e.g., “storage”).
- Only products in these categories will receive the discount for the specified role.
- Per-Product Pricing:
- Edit a product and use the Quick Edit option to set role-specific prices.
- Alternatively, configure prices in the product’s Role Based Pricing settings.
Debugging
- The plugin includes detailed debug logging to troubleshoot pricing issues.
- Logs are stored in
/wp-content/uploads/simple-role-based-pricing/simproba-debug.log. - To view logs:
bash
tail -n 200 /var/www/html/wordpress/wp-content/uploads/simple-role-based-pricing/simproba-debug.log
Installation
- Upload the
simple-role-based-pricingfolder to/wp-content/plugins/. - Activate the plugin through the Plugins menu in WordPress.
- Go to WooCommerce > Settings > Role Based Pricing to configure global pricing rules.
- Optionally, edit individual products to set role-specific prices via Quick Edit or the product settings.
Reviews
There are no reviews for this plugin.
Contributors & Developers
“Simple Role Based Pricing” is open source software. The following people have contributed to this plugin.
ContributorsTranslate “Simple Role Based Pricing” into your language.
Interested in development?
Browse the code, check out the SVN repository, or subscribe to the development log by RSS.
Changelog
1.1.7
- Changed: Long time deprecated ${var} by {$var} , stopping all related php 8+ warnings by the way
1.1.6
- Added / Fixed: Discount wasn’t applied at checkout. At all. So coupon method was applied for clearness.
1.1.4
- Added: Pro version indicator for “Specific Categories” option in the Apply To selector, with a modern inline notification for free version users.
1.1.3
- Fixed: Css overstep beyond role-pricing tab + overthrow main woocommerce aspect with first rule
1.1.2
Table name interpolation is to be ignored.
1.1.1
- Fixed: Added missing translators comments in product-fields.php for internationalization.
- Fixed: Corrected SQL queries in multiple files to properly use $wpdb->prepare() without backticks.
- Fixed: Enhanced sanitization for $_POST categories input in admin-settings.php.
- Fixed: Replaced all %s strings that define tables names in prepared requests by identifier %i.
1.1.0
- Fixed: Addressed security issues from QIT tests (data sanitization, SQL queries, nonces).
- Fixed: Corrected WordPress.org Plugin Check violations (internationalization, WP_Filesystem).
- Fixed: Corrected SQL syntax errors in database queries.
- Fixed: Improved log file permission handling.
1.0.9
- Added: changelog.txt file for WooCommerce Marketplace submission.
- Tweak: Ensured compliance with WooCommerce submission requirements.
1.0.8
- Added: Changelog section to readme.txt for WooCommerce Marketplace submission.
- Tweak: Updated documentation for clarity.
1.0.7
- Fixed: Improved compatibility with WooCommerce 9.0.
- Added: Support for variable product pricing per user role.
- Tweak: Optimized debug logging for better performance.
1.0.6
- Added: Category restriction option for role-based pricing.
- Fixed: Bug in Quick Edit pricing for specific user roles.
1.0.5
- Added: Crash Handling.
- Fixed: This plugin won’t crash anymore if the required packages are not installed but simply warn the user.
1.0.4
- Added: Dynamic Translation.
1.0.3
- Added: Translation.
1.0.2
- Fixed: Better Category Handling.
1.0.1
- Added: New Style.
1.0.0
- Added: First version.



