Title: Simple Role Based Pricing
Author: Thomas Lloancy
Published: <strong>May 21, 2025</strong>
Last modified: May 24, 2026

---

Search plugins

![](https://ps.w.org/simple-role-based-pricing/assets/banner-772x250.png?rev=3297813)

![](https://ps.w.org/simple-role-based-pricing/assets/icon-128x128.png?rev=3297813)

# Simple Role Based Pricing

 By [Thomas Lloancy](https://profiles.wordpress.org/tlloancy/)

[Download](https://downloads.wordpress.org/plugin/simple-role-based-pricing.2.4.0.zip)

 * [Details](https://wordpress.org/plugins/simple-role-based-pricing/#description)
 * [Reviews](https://wordpress.org/plugins/simple-role-based-pricing/#reviews)
 *  [Installation](https://wordpress.org/plugins/simple-role-based-pricing/#installation)
 * [Development](https://wordpress.org/plugins/simple-role-based-pricing/#developers)

 [Support](https://wordpress.org/support/plugin/simple-role-based-pricing/)

## 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.
 * **Admin workspace**: Block-based settings with a draggable **Plan minimap**, 
   collapsible sections, and per-user saved block order.
 * **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

 1. **Global Rules**:
 2.  * 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.
     * Use the **Plan minimap** (right column on wide screens) to reorder blocks; order
       is saved automatically per user.
 3. **Category Restrictions**:
 4.  * 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.
 5. **Per-Product Pricing**:
 6.  * 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

## Screenshots

 * [[
 * [[
 * [[

## Installation

 1. Upload the `simple-role-based-pricing` folder to `/wp-content/plugins/`.
 2. Activate the plugin through the **Plugins** menu in WordPress.
 3. Go to **WooCommerce > Settings > Role Based Pricing** to configure global pricing
    rules.
 4. 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.

Contributors

 *   [ Thomas Lloancy ](https://profiles.wordpress.org/tlloancy/)

[Translate “Simple Role Based Pricing” into your language.](https://translate.wordpress.org/projects/wp-plugins/simple-role-based-pricing)

### Interested in development?

[Browse the code](https://plugins.trac.wordpress.org/browser/simple-role-based-pricing/),
check out the [SVN repository](https://plugins.svn.wordpress.org/simple-role-based-pricing/),
or subscribe to the [development log](https://plugins.trac.wordpress.org/log/simple-role-based-pricing/)
by [RSS](https://plugins.trac.wordpress.org/log/simple-role-based-pricing/?limit=100&mode=stop_on_copy&format=rss).

## Changelog

#### 2.4.0 (2026-05-24)

 * Fixed: Plan minimap stays synced with block order and persists across page reloads(
   single blockOrder source of truth).
 * Fixed: Reordering in the Plan updates the real block layout (including moving
   All Products / Specific Categories into the stack when it is not first in the
   plan).
 * Fixed: Block order AJAX save uses proper JSON decoding.
 * Added: Minimap-style Plan panel with draggable previews reflecting block size
   and collapsed state.
 * Added: Full-width page layout map above the form (wireframe like a 33% zoom of
   the page); contextual sidebar for role / apply-to only.
 * Added: Fractal block previews (overview table, category lists, etc.) and visible
   empty column slots.
 * Added: Visible empty slots (dashed areas) and stack drop zones for clearer drag
   targets.
 * Added: Reorder blocks by dragging chips on the layout map, not only a flat list.
 * Added: Layout map folded by default; expand when you need to reorder blocks.
 * Fixed: All Products can be moved back into the top column from the stack.
 * Added: Context sidebar lists blocks for quick jump (reorder via layout map only).
 * Changed: Top column for All Products only when explicitly dropped there; first
   stack position keeps the column empty.
 * Fixed: Stack-only All Products layout persists after refresh (pinned state saved
   even when order array unchanged).

#### 2.3.8 (2026-05-24)

 * Fixed: On wide screens, Specific Categories block offset 72px below Select Role
   so Select2 dropdown stays visible.

#### 2.3.7 (2026-05-24)

 * Fixed: Planning Start/End dates both visible on mobile (stacked layout, full-
   width datetime inputs).

#### 2.3.6 (2026-05-24)

 * Fixed: Responsive layout for Apply To / Specific Categories (top row, category
   lists, selected category rows).

#### 2.3.5 (2026-05-24)

 * **Fix**: All Products discounts were not applied on the storefront (PriceCalculator
   now reads discount data from the `global` JSON structure).
 * **Fix**: Category rules with type Global now correctly inherit the role default
   discount.
 * **Fix**: Default discount type and value fields stay visible in Specific Categories
   mode (defines what Global means per category).

#### 2.3.4 (2026-05-24)

 * **Fix**: Clicking a category name in Selected Categories now selects the row (
   same as Available Categories).
 * **Tweak**: Category name shows pointer cursor in selected list.

#### 2.3.3 (2026-05-24)

 * Bump: Readme version was still in 2.3.1.

#### 2.3.2 (2026-05-24)

 * Fix 2.3.1: restore working Enable toggle (revert to 2.2.0 label pattern)

#### 2.3.1 (2026-05-24)

 * **Fix**: Enable toggle was not clickable after the 2.3.0 layout change (restored
   label association and full hit area on the switch).

#### 2.3.0 (2026-05-24)

 * **Admin workspace**: New block-based settings layout with collapsible sections,
   drag-and-drop reordering, and a sticky “Plan” sidebar for quicker navigation.
 * **Clearer role setup**: Removed the redundant “Role configuration” block. The
   Enable switch now sits directly under Select Role and Apply To.
 * **Apply To–driven UI**: The main content block title follows your Apply To choice(
   All Products / Specific Categories). Discount type and value appear for All Products;
   the category picker appears for Specific Categories.
 * **Per-role Apply To**: Switching roles restores the correct Apply To value for
   that role.
 * **Rule status badge**: Live indicator next to Enable (Inactive, Active, Scheduled,
   Expired).
 * **Unsaved changes**: Warning when editing without saving; confirmation before
   switching roles.
 * **Review notice**: Optional WordPress.org review prompt after 30 days (dismissible).
 * **Fix**: Block order no longer corrupted after save (fixes broken admin UI after
   reload).
 * **Fix**: Single admin asset enqueue; settings description visible again.
 * **Compatibility**: Tested up to WordPress 7.0.

#### 2.2.0 (2026-05-05)

 * Removal of the mbstring dependency — it was limiting and causing friction during
   activation

#### 2.1.2 (2026-05-04)

 * **Internationalization Complete**: All text strings are now properly prepared
   for translations (i18n). Ready for multiple languages.

#### 2.1.1 (2026-05-03)

 * **Database Optimization**: Fully deprecated the legacy SQL schema.
 * **Data Migration**: Successfully moved all standalone columns (‘discount_type’,‘
   discount_value’, ‘categories’) into a unified ‘rules’ JSON blob.
 * **Logic Fix**: Corrected category name retrieval in the Overview table (no more“
   ID: 1” fallback).
 * **Currency Support**: Switched to native WooCommerce currency symbols for global
   compatibility.

#### 2.1.0 (2026-05-02)

 * **Major Architecture Overhaul**: Migrated data storage to a centralized JSON 
   format for superior flexibility and future-proofing.
 * **Smart Time-Based Rules**: Introduced a scheduling system to define specific
   start and end dates for role-based discounts.
 * **Per-Category Granularity**: Enabled unique discount types and values for each
   category individually, independent of global role settings.
 * **Advanced Admin Interface**: Implemented a dynamic category selector with real-
   time JSON rule generation and improved UI feedback.
 * **Optimized Pricing Engine**: Refactored the calculation logic into a dedicated
   class for better performance and easier debugging.
 * **Enhanced Data Integrity**: The system now dynamically filters active rules 
   based on date validity at the point of calculation.

#### 2.0.3 (2026-04-30)

 * Improvement: Added a clear notice in the settings to explain how individual user
   price overrides work.

#### 2.0.2 (2026-04-30)

 * UI: Added expandable category previews in the Role Overview table for better 
   configuration tracking.

#### 2.0.1 (2026-04-30)

 * Fix: Resolved role selector UI freeze caused by WooCommerce Select2 overlay. 
   Bug present since 1.2.0 i’m truely sorry for didn’t paying attention.
 * Fix: Implemented jQuery-based event listeners to properly detect role changes
   when Select2 is active.
 * Debug: Restored admin console logging to improve real-time troubleshooting of
   DOM interactions.

#### 2.0.0

 * Major: Complete pricing engine refactor. Fully migrated from the “Legacy Coupon”
   system to a “Native Filter” architecture (improved performance and stability).
 * New Feature: User-Specific Pricing (Granularity). You can now set custom discounts
   for individual users that override global role-based rules.
 * Stability: Implemented an anti-loop static flag ($is_calculating) to prevent 
   server crashes during recursive price calls.
 * Compatibility: Added REST API and Admin-side detection to ensure prices remain
   original during data exports or back-office management.
 * Logic: Improved conflict management. The plugin now automatically yields if a
   product is already on native sale or if an “Individual use” coupon is applied
   to the cart.
 * Tweak: Tested and confirmed compatibility with WooCommerce 10.7 and WordPress
   6.7.
 * Cleanup: Conditionnal Class Loading and Removed redundant debug logs and optimized
   class loading for a lighter footprint.

#### 1.2.2

 * Fix: Add missing ‘enable’ column and move DB setup to activation.

#### 1.2.1

 * Fix: Some console logs were badly commented.

#### 1.2.0

 * Performance: Cleaned up all debug logs and console.log for production use.
 * Fix: Added explicit WooCommerce activation check.
 * Fix: Declared full High-Performance Order Storage (HPOS) compatibility.
 * Fix: UI Overhaul – Removed custom background styles to match WooCommerce Native
   UI.

#### 1.1.9

 * Made Specific Categories fully free and usable without Pro restrictions.

#### 1.1.8

 * Improvement: Switched to modern WooCommerce pricing flow using native get_price
   filters for item prices, subtotals, and totals (no artificial coupon needed on
   WC >= 3.2).
 * Fix: Correct category handling for variable products (now uses $product->get_category_ids()
   instead of wp_get_post_terms on variation ID).
 * Added: Automatic cart recalculation on user login to apply role-based prices 
   if user logs in after adding items to cart.
 * Added: Explicit set_price() calls on woocommerce_before_calculate_totals hook
   for maximum reliability.
 * Changed: Coupon ‘simproba_role_discount’ is no longer created or applied on WooCommerce
   >= 3.2  cleaner checkout display (no mystery discount line).
 * Tweak: Refactored pricing logic into a reusable method to reduce duplication 
   and improve maintainability.
 * Note: Fully backward compatible – coupon logic remains active only for very old
   WooCommerce versions (< 3.2).

#### 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.

## Meta

 *  Version **2.4.0**
 *  Last updated **1 week ago**
 *  Active installations **30+**
 *  WordPress version ** 5.0 or higher **
 *  Tested up to **7.0**
 *  PHP version ** 7.4 or higher **
 * Tags
 * [discounts](https://wordpress.org/plugins/tags/discounts/)[Role based pricing](https://wordpress.org/plugins/tags/role-based-pricing/)
   [user roles](https://wordpress.org/plugins/tags/user-roles/)[woocommerce](https://wordpress.org/plugins/tags/woocommerce/)
 *  [Advanced View](https://wordpress.org/plugins/simple-role-based-pricing/advanced/)

## Ratings

No reviews have been submitted yet.

[Your review](https://wordpress.org/support/plugin/simple-role-based-pricing/reviews/#new-post)

[See all reviews](https://wordpress.org/support/plugin/simple-role-based-pricing/reviews/)

## Contributors

 *   [ Thomas Lloancy ](https://profiles.wordpress.org/tlloancy/)

## Support

Got something to say? Need help?

 [View support forum](https://wordpress.org/support/plugin/simple-role-based-pricing/)