View Categories

Set Per-User or Per-Role Maximum Product Limits

Table of Contents

Problem Description #

Store owners want to set different maximum product limits per user or per user role (e.g. user X gets 5, user Y gets 10), but find the interface confusing or consider manual configuration tedious.

Common symptoms:

  • Users asking “Is it possible to set different limitation per user?” or “Limit only for certain users.” WordPress.org+1
  • Others complaining of lack of import feature if many users need custom limits. WordPress.org+1

Cause:

  • The plugin supports per-user or per-role limits via its “Formula” feature, which requires manually writing shortcodes with user_id and product_id (or global), not very user-friendly for large user base. WordPress.org+1
  • There is no CSV import or bulk user-based limit assignment, users need to manually specify each combination. WordPress.org

Solution (step‑by‑step)

  1. Go to WooCommerce → Settings → Maximum Products per User → Formula.
  2. Enable “Limits by formula”.

Use shortcode syntax to define custom limits, for example:

[alg_wc_mppu limit=”5″ user_id=”123″ product_id=”456″]  

  1.   this limits product 456 to max 5 units per user with ID 123. WordPress.org
  2. For multiple users or products, you can list multiple IDs separated by commas, e.g.: user_id=”123,124″ product_id=”456,457″ WordPress.org
  3. Save settings and test using those user accounts to ensure limits apply.
  4. For large numbers of users, maintain a spreadsheet with user IDs and product IDs, though plugin currently lacks CSV import, you can generate shortcodes programmatically and paste into “Formula” setting.

Prerequisites

  • Basic knowledge of user IDs and product IDs in WooCommerce.
  • Access to plugin settings and ability to edit shortcodes.

Additional Notes

  • Because there is no import feature, this method suits small-to-medium user bases. For large stores, consider whether a custom script or a different solution may better fit.

Document each formula used outside the plugin (in a spreadsheet or external doc) to manage and track custom limits.

 

Maximum Products per User for WooCommerce