Tested Updated Trending Bestseller Perfect rating Documented

Maximum Products per User for WooCommerce

(8 customer reviews)

From: $29.99 / year

Limit the number of items your WooCommerce customers can buy (lifetime or in selected date range).

Clear

Description

With “Maximum Products per User for WooCommerce” plugin you can limit the number of items your WooCommerce customers can buy. Item limits for user can be set on lifetime basis or in selected date range (i.e. not per order). Limits can be set for all products at once, on per product basis, per product category or per product tag. You can choose if you want to limit product quantities, prices (i.e. sums) or weights.

Main Features

  • Set maximum products number per user.
  • Select plugin mode: product quantities, product prices or product weights.
  • Set date range (for example: lifetime, this month, this year, last 30 days, last 365 days or custom date range).
  • Set on which order statuses product data should be updated.
  • Set different maximum product limits for different user roles.
  • Enable variable products variations usage.
  • Customize customer message on frontend.
  • Optionally block checkout page on exceeded limits.
  • Exclude products from plugin scope.
  • Optionally edit each user’s sales data.
  • Optionally choose which payment gateways should update product data.
  • Display remaining, maximum limits etc. to the users on single product page, on “My account” page or with a shortcode anywhere on your site.
  • Optionally block guests from buying products in your shop.
  • Set product limits per product category.
  • Set product limits per product tag.
  • Set product limits per individual product.
  • Set product limits by formula (e.g. per user ID; per membership plan etc.).
While data is recalculated automatically (but only after the plugin was enabled), you can also force manual recalculation by running Recalculate sales data tool. This is useful on initial plugin install (i.e. to calculate sales data from before the plugin was enabled).

Options

Plugin settings are located in “WooCommerce > Settings > Maximum Products per User”.

General Options

General settings are located in “WooCommerce > Settings > Maximum Products per User > General”.

Maximum Products per User for WooCommerce - General Options

Mode
You will need to Recalculate sales data after changing the “Mode” option. Possible values: Product quantities; Product prices; Product weights.
Default: Product quantities
Date range
Possible values: Lifetime; This hour; This day; This week; This month; This year; Last hour; Last 24 hours; Last 7 days; Last 30 days; Last 365 days; Custom.
Default: Lifetime
Custom date range (in seconds)
Used when “Custom” option is selected in “Date range”.
Default: 3600
Order statuses
Choose order statuses when product data should be updated. If you select multiple order statuses, data is updated only once, on whichever status change occurs first. You will need to Recalculate sales data after changing the “Order statuses” option.
Default: Completed
Payment gateways
Choose payment gateways when product data should be updated. Leave empty to update data for all payment gateways. You will need to Recalculate sales data after changing “Payment gateways” option.
Default: None
Use variations
Use variations in “All products” and “Per product” calculations.
Default: no
User roles
Set different maximum product limits for different user roles.
Default: no
Block guests
Blocks non-logged users (i.e. guests) from buying products in your shop.
Default: no
Block guests: Message
You can use HTML and/or shortcode here. E.g.: [alg_wc_mppu_translate].
Default:
You need to register to buy products.

Frontend Options

Frontend settings are located in “WooCommerce > Settings > Maximum Products per User > Frontend”.

Maximum Products per User for WooCommerce - Frontend Options

Validate on add to cart
Enable this if you want to check user limits right away, on add to cart button click, instead of notice on cart and checkout pages only.
Default: yes
Cart notice
Shows notice on the cart page.
Default: yes
Customer message
Placeholders: %limit%, %product_title%, %bought%, %remaining%. You can also use HTML and/or shortcode here. E.g.: [alg_wc_mppu_translate] for WPML/Polylang translations.
Default:
You can only buy maximum %limit% of %product_title% (you've already bought %bought%).
Block checkout page
This will stop customer from accessing the checkout page on exceeded limits. Customer will be redirected to the cart page.
Default: no
Single product page
Adds current product limit info to the single product pages. Possible values: Disable; Notice; Text.
Default: Disable
Single product page: Content
Placeholders: %limit%, %product_title%, %bought%, %remaining%. You can also use HTML and/or shortcode here. E.g.: [alg_wc_mppu_translate].
Default:
The remaining quantity for %product_title% is %remaining% (you've already bought %bought% out of %limit%).
My Account
Adds tab to the “My Account” page.
Default: no
My Account: Tab id
Sets tab id (i.e. slug).
Default: product-limits
My Account: Tab title
Sets tab title.
Default: Product limits
Maximum Products per User for WooCommerce - My Account
Frontend “My Account” tab example.

All Products

Maximum Products per User for WooCommerce - Limits - All Products
Limits for all products (with “User roles” option enabled).
All products
Enables “All products” section.
Default: no
Limit per user
Maximum allowed each product’s limit per user.
Default: 1

Per Product Taxonomy

Maximum Products per User for WooCommerce - Per Product Taxonomy Options

Per product tag
This will add new meta box to each product tag term’s edit page.
Default: no
Per product category
This will add new meta box to each product category term’s edit page.
Default: no

When section is enabled, you will see new “Limit per user” option in “Products > Categories > Your category > Edit” and/or “Products > Tags > Your tag > Edit”:

Maximum Products per User for WooCommerce - Per Product Taxonomy Options - Meta Box
Limits for product category (with “User roles” option enabled).

Per Product

Maximum Products per User for WooCommerce - Per Product Options

Per product
Enables “Per product” section. This will add new meta box to each product’s edit page.
Default: no

Per product meta box for variable product with “Use variations” option enabled:

Maximum Products per User for WooCommerce - Per Product Meta Box - Variations

Per product meta box for simple product or for variable product with “Use variations” option disabled:

Maximum Products per User for WooCommerce - Per Product Meta Box - Simple

Per product meta box with User roles option enabled:

Maximum Products per User for WooCommerce - Per Product Options - User Roles

Limits by Formula

This section introduces an alternative method for setting max limits.

Maximum Products per User for WooCommerce - Max Quantity by Formula

Enable
Enables/disables “Limits by Formula” section.
Default: no
Formula
One shortcode per line.
Default: None

Notes

  • You need to use [alg_wc_mppu] shortcode here.
  • One shortcode per line.
  • Algorithm stops when first matching shortcode is found (from top to bottom).
  • Available shortcode attributes: user_id, user_role, product_id, term_id, limit.
  • limit attribute and at least one other attribute are required.
  • You need to enable “Per Product” checkbox in “Limits” section to use product_id attribute.
  • You need to enable “Per product category” and/or “Per product tag” checkbox in “Limits” section to use term_id attribute.
  • You can not use product_id and term_id simultaneously in one shortcode.

Formula Examples

Set maximum quantity to 18 for users 2 and 5:

[alg_wc_mppu limit="18" user_id="2,5"]

Set maximum quantity to 18 for products 100 and 110 for users 2 and 5:

[alg_wc_mppu limit="18" user_id="2,5" product_id="100,110"]

Max quantity by user’s membership plan (you need to use membership plan slug in shortcode):

[alg_wc_mppu limit="3" membership_plan="silver"]
[alg_wc_mppu limit="36" membership_plan="gold"]

Admin Options

Maximum Products per User for WooCommerce - Admin Options

Editable sales data: Enable
You will be able to edit each user’s sales data on user’s edit page (in “Users”).
Default: no
Editable sales data: Add empty items
Adds “Lifetime” column for products/terms with no sales data.
Default: no

Tools

Check the box and save settings to run the tool. Please note that there is no undo for this action.

Maximum Products per User for WooCommerce - Tools

Recalculate sales data
Default: no
Delete & recalculate sales data
Default: no
Delete sales data
Default: no

Tools: Advanced Options

Advanced options for both recalculation tools. Leave the default values if not sure.

Orders date range
Possible values: All orders; Only orders in “General > Date range”.
Default: All orders
Query block size
How many orders to process in a single query.
Default: 1024
Time limit
The maximum execution time, in seconds. If set to zero, no time limit is forced. If set to minus one, server time limit is used.
Default: -1
Loop function
Possible values: WordPress standard (WP_Query); WooCommerce specific (wc_get_orders).
Default: WordPress standard (WP_Query)
Debug
Default: no

Advanced Options

Maximum Products per User for WooCommerce - Advanced Options

Time function
Possible values: Server time; WordPress time.
Default: Server time
Exclude products
You will need to “Recalculate sales data” for products to be excluded from sales data.
Default: None
Duplicate product
Enable this if you want to copy plugin’s product meta data on product “Duplicate”.
Default: no

Sales Data

You can check saved sales data for each product, by opening admin product’s edit page. For variable products you will see data for each variation as well. Similar “Sales Data” tables can be found on each category/tag edit pages:

Maximum Products per User for WooCommerce - Product Sales Data

Shortcodes

Available shortcodes:

  • [alg_wc_mppu_current_product_limit]
  • [alg_wc_mppu_user_product_limits]
  • [alg_wc_mppu_term_limit]
  • [alg_wc_mppu_translate]
  • [alg_wc_mppu]

[alg_wc_mppu_current_product_limit]

Displays current product data for the current user, for example, maximum limit, amount already bought, remaining amount etc.

product_id
(optional) Product ID. If not set, will use current product ID.
Default: None
user_id
(optional) User ID. If not set, will use current user ID.
Default: None
template
(optional) Output template. If not set, will use “WooCommerce > Settings > Maximum Products per User > Frontend > Single product page” option value. Available placeholders: %limit%, %bought%, %remaining%, %product_title%.
Default: None
Example
[alg_wc_mppu_current_product_limit template="The remaining amount for %product_title% is %remaining% (you've already bought %bought% out of %limit%)."]

[alg_wc_mppu_user_product_limits]

Displays all products data for the current user. Outputted as a table with “Product”, “Remaining”, “Bought” and “Max” columns.

user_id
(optional) User ID. If not set, will use current user ID.
Default: None
Example
[alg_wc_mppu_user_product_limits]

[alg_wc_mppu_term_limit]

Displays amounts data for the term, i.e. product category or tag.

Example
[alg_wc_mppu_term_limit taxonomy="product_cat" term_slug="t-shirts"]
[alg_wc_mppu_term_limit taxonomy="product_cat" term_id="33"]

[alg_wc_mppu_translate]

Can be used in plugin options for WPML/Polylang translations.

Example
[alg_wc_mppu_translate lang="DE" lang_text="Message in German" not_lang_text="Message for all other languages"]
[alg_wc_mppu_translate lang="DE"]Message in German[/alg_wc_mppu_translate][alg_wc_mppu_translate not_lang="DE"]Message for all other languages[/alg_wc_mppu_translate]

[alg_wc_mppu]

Can be used only in “WooCommerce > Settings > Maximum Products per User > Formula” section.

8 reviews for Maximum Products per User for WooCommerce

  1. blank

    han van (verified owner)

    a perfectly functioning plugin, but then we want something else, we always do 🙂 and Tom fixes it for you. amazing support!

  2. blank

    Chuck Varabioff (verified owner)

    Amazing product, it is exactly what I was looking for. Very simple installation and configuration. Customer service is also lightning fast 🙂

  3. blank

    Dino

    I always value a plugin not only by its features, but by its support. Tom has been fantastic at helping me get this plugin adapted to the specifics of my stores needs. I have tried another plugin prior and honestly their support is the worst. I will always pay more for a plugin/app/software if the reviews have killer support so I know Tom and this plugin deserved it. Not to mention the plugin itself is feature rich. Thanks Tom 🙂

  4. blank

    Parm Gill (verified owner)

    Amazing support!

  5. blank

    Badr (verified owner)

    Great product, great customer support.

  6. blank

    gabriel_cc (verified owner)

    The plugin works great and the support is excellent, fast and comunicative.
    Very happy with the purchase!

  7. blank

    marco (verified owner)

    Excellent support from the team. Works as expected, and 1 on 1 support from the developer too. Thank you very much.

  8. blank

    Adam

    Simply perfect!

Add a review

Your email address will not be published. Required fields are marked *

150 thoughts on "Maximum Products per User for WooCommerce"

  1. Is it possible to set date ranges on a customer level? Example customer 1 has a 3 order limit per 30 days, customer 2 has a 3 order limit per 2 weeks.

    Also, for the frontend messages, I would like to use some of the placeholders that are available in the customer message for the single product page, specifically %bought_plus_in_cart%. Can this be done?

    1. Hi Jacob,

      1. Date ranges on a customer level…

      Yes, that’s possible, however, with a small PHP snippet. You need to set your “Date range” to “Last 30 days” in plugin settings, as you would normally do, and add exceptions for some users:

      add_filter( 'alg_wc_mppu_date_to_check', 'my_alg_wc_mppu_date_to_check', 10, 6 );
      if ( ! function_exists( 'my_alg_wc_mppu_date_to_check' ) ) {
          function my_alg_wc_mppu_date_to_check( $date_to_check, $date_range, $current_time, $product_or_term_id, $current_user_id, $is_product ) {
      
              // TODO: You need to add your user exceptions here; in "user ID => days" format.
              $users = array(
                  123 => 14,
                  124 => 14,
              );
      
              return ( isset( $users[ $current_user_id ] ) ? ( $current_time - $users[ $current_user_id ] * DAY_IN_SECONDS ) : $date_to_check );
          }
      }
      

      You only need to change the code in the snippet where it says “TODO: You need to add your user exceptions here”.

      Please note that for this filter to be applied, the “Date range” option must not be set to “Lifetime”.

      Please give it a try and let me know if something is not working as expected, or if you have any questions.

      2. Placeholders in the “Single product page” message…

      Unfortunately, currently, not all placeholders are available in the “Single product page” option, but let me try to add them there. Will get back to you about this asap.

  2. I have a limit of 4 per product category set up and am wondering if there is a way to make a specific variation count as 4 instead of 1. In my case, the limit is set on a “cards” category. Normally people purchase individual cards, but there are now variations that are Packages of 4 cards which need to count as 4 instead of 1. Is there a function I can use to multiply the quantity for these specific products?

    1. Hi Chris,

      First solution that comes to mind – you can set the plugin’s “Mode” option (in “WooCommerce > Settings > Maximum Products per User > General”) to “Product weights”, and then set weights for “normal” variations to “1”, and weight for that “special” variation to “4”. In all frontend notices you can still say “quantity”, so customers won’t really understand that you are limiting it by weight. P.S. Don’t forget to “Recalculate sales data” after changing the “Mode” option.

      If that’s not good enough (e.g. if you are using real product weights for shipping), we can do it with PHP snippet, which you’d have to add to e.g. your (child) theme’s functions.php file. Please let me know if this is what you prefer, and I will send you the snippet.

    2. Thanks for the weight suggestion Tom. Unfortunately that’s not going to work because I have very specific weights set for each variation that don’t divide evenly. If you can help get me on the right track with a snippet that would be great!

    3. Sure. Please give me a couple of hours or so…

    4. Hi again, Chris,

      As promised, here is the snippet below. You need to change only one place there – where it says “TODO: you need to add your products with special quantities here”. Please give it a try and let me know if it’s working as expected:

      add_filter( 'alg_wc_mppu_get_cart_item_quantities',         'my_alg_wc_mppu_get_cart_item_quantities',         PHP_INT_MAX );
      add_filter( 'alg_wc_mppu_validate_on_add_to_cart_quantity', 'my_alg_wc_mppu_validate_on_add_to_cart_quantity', PHP_INT_MAX, 2 );
      add_filter( 'alg_wc_mppu_save_quantities_item_qty',         'my_alg_wc_mppu_save_quantities_item_qty',         PHP_INT_MAX, 2 );
      
      if ( ! function_exists( 'my_alg_wc_mppu_maybe_change_qty' ) ) {
          function my_alg_wc_mppu_maybe_change_qty( $product_id, $qty ) {
      
              // TODO: you need to add your products with special quantities here; in "product (or variation) ID => quantity multiplier" format.
              $products = array(
                  123  => 4,
                  125  => 4,
              );
      
              return ( isset( $products[ $product_id ] ) ? $products[ $product_id ] * $qty : $qty );
          }
      }
      
      if ( ! function_exists( 'my_alg_wc_mppu_save_quantities_item_qty' ) ) {
          function my_alg_wc_mppu_save_quantities_item_qty( $item_qty, $item ) {
              $product_id = ( ! empty( $item['variation_id'] ) ? $item['variation_id'] : $item['product_id'] );
              return my_alg_wc_mppu_maybe_change_qty( $product_id, $item_qty );
          }
      }
      
      if ( ! function_exists( 'my_alg_wc_mppu_validate_on_add_to_cart_quantity' ) ) {
          function my_alg_wc_mppu_validate_on_add_to_cart_quantity( $quantity, $product_id ) {
              return my_alg_wc_mppu_maybe_change_qty( $product_id, $quantity );
          }
      }
      
      if ( ! function_exists( 'my_alg_wc_mppu_get_cart_item_quantities' ) ) {
          function my_alg_wc_mppu_get_cart_item_quantities( $cart_item_quantities ) {
              foreach ( $cart_item_quantities as $product_id => &$quantity ) {
                  $quantity = my_alg_wc_mppu_maybe_change_qty( $product_id, $quantity );
              }
              return $cart_item_quantities;
          }
      }
      
  3. The Plugin (Maximum Products per User for WooCommerce) Can this be used Per a Membershp, as I want to do the following

    I am starting a Site where users can download SVG files, so Digital products, I have searched and searched Woocommerce platform for what I need as per below:, so basically
    So, a different number of downloadable products for every plan I create,
    Members can Have Memberships as Follows
    Basic:
    5 Product Downloads Per day
    Basic Plus
    10 Product Down Per day
    Basic Unlimited
    Unlimited Product Downloads

    I have seen many site offer similar where product downloads are offered within a package but restricted to X amount of downloadable products per days weeks etc, Have you anything that can do this?

  4. Is below scenario achievable or not using the pro version of this plugin?
    Per product category: Enable
    Limit per user: 5

    Example 1: if user A purchased five products that belong to Product Category A, user A will not be able to buy any more product that also assigns to similar Product Category A.
    Example 2: Product A1, Product A2, Product A3 & Product A4 assign to Product Category A.
    If user A purchased 4 Product A1, user A can still buy 1 Product from either Product A2, Product A3, Product A4.

    1. Hi,

      Yes, that’s correct. This is exactly how “Per product category” option is working in our plugin.

      Maybe one small note. You wrote:

      “If user A purchased 4 Product A1, user A can still buy 1 Product from either Product A2, Product A3, Product A4.”

      To be exactly correct, it should be:

      “If user A purchased 4 Product A1, user A can still buy 1 Product from either Product A1, Product A2, Product A3, Product A4.”

      i.e. he can still buy 1 x “Product A1” as well.

      Hope that helps. Please let me know if you have any questions.

  5. hi, i just bought your plugin.
    i want to allow people to only buy max 1 variation in a product subscription (WooCommerce Subscriptions). they should still be able to up or downgrade the variation. is this possible?

    Han

    1. Hi,

      Yes, I believe this is possible.

      1. First you need to enable “Use variations” checkbox in “WooCommerce > Settings > Maximum Products per User > General”.

      2. Then you need to enable “Per product” checkbox in “WooCommerce > Settings > Maximum Products per User > Limits”.

      3. After that you need to go to your variable subscription product admin edit page, and there you will be able to set limit (i.e. 1) for the variation you need. Leave it as zero for other variations.

      Hope that helps. Please let me know if you have any questions.

    2. Update: after reading your question again, I’m now thinking – maybe you meant “… buy 1 of any variation…” (i.e. no matter which variation)? If that’s the case, then you don’t need to enable “Use variations” checkbox from my previous post. I.e. in this case steps are:

      1. Enable “Per product” checkbox in “WooCommerce > Settings > Maximum Products per User > Limits”.

      2. Go to your variable subscription product admin edit page, and set limit to 1.

      Please let me know if I misunderstood you.

    3. Yes, with the variation option disabled it all work fine.
      but i have multiple subscription products. some of them i want the user to be able to buy multiple variations.

      i enable ‘Variations’ and ‘All products’ is set to 1 and ‘Per product’ is on in your plugin;
      when i set all the variations in the subscription product to 0 (i would think global setting would prevail) a user can still buy more than one variation of the subscription. namely the global setting of 1 is applied to every separate variation. is this correct?

    4. Hi,

      Yes, when you enable the “Use variations” option, each variation is treated as an individual product. So if you set the limit to 0, then (as you correctly noted) “All products” value is used as a fallback. If I understood you correctly, what you actually need is to keep the “Use variations” option enabled, but make an exclusion for some products, and for them use limit as if the “Use variations” option is disabled. If that’s correct, I could try to add this feature to the plugin. Also, if you’d like a faster solution, I could come up with a PHP snippet, which you would need to add to your (child) theme’s functions.php file. Please let me know what you think.

    5. hi,
      your suggestion is extremely useful but it would not solve my current challenge.
      i am using a variable product in a product bundle (https://woocommerce.com/products/product-bundles/)

      this plugin stops your plugin from recognizing the variable subscription product as bought because the product-bundle is product itself. the variable subscription shows as bought in the account-page though.

      i would like users to be able to choose and buy only one variation of a product inside a bundled product. so if your plugin could detect that the user has bought a variation, none of the other variations can be bought.

    6. Hi,

      Would it be possible for me to log in to your site? It would be much easier for me to understand the task then. If that’s possible, my email is [email protected].

  6. Hi there
    I have using the plugin for a long time. but now I want that after exceeding the maximum limit a user needs to buy memberships for more.
    how can I do that?

    1. Hi,

      Sorry for the late reply.

      Not sure if I understood it correctly. Do you mean that you have set max limit for all users now, and you want to set different limits for users with memberships? If that’s the case, you will need to additionally enable our “Formula” section (in “WooCommerce > Settings > Maximum Products per User > Formula”), and set it to something like:

      [alg_wc_mppu limit="10" membership_plan="silver"]
      [alg_wc_mppu limit="15" membership_plan="gold"]

      Please let me know if I misunderstood you.

    2. suppose there is a gold member on my site his membership length is 30 days and his limit to buy 30 products.
      And I want that after reaching 30 products his membership will expires automatically, no matter how long his membership length remains.
      How can I do that.

    3. Hi,

      Unfortunately, I don’t think our plugin can cancel membership at the moment. I could try to implement it, but to be honest, I’m not sure which “WooCommerce Memberships” plugin function should I call to cancel membership for a user. Will be looking into it more…

      P.S. I’m not sure if this will help, but some of our plugin’s users were using the membership subscription start date as a date to start counting products from. I.e. instead of checking the last 30 days, the plugin will check how many products did user buy since his membership subscription start date. If that’s something that may help you, let me know, and I’ll help you with setting this up on your site.

  7. Hi There,

    I have set a limit 5 for a product category. This part works very well.
    If the buyer cancels his order, the purchase limit will not change. In this case, this purchase option is not revoked.
    What could be the solution?
    Thank you

    1. Hi,

      Sorry for the late reply. Yes, I’m aware of the problem – already working on it. I’m planning to add an option to select order statuses to decrease amounts in the next plugin version. Meanwhile, you can either manually edit sales data on the user’s profile page, or run the plugin’s “recalculate data” tool which will skip canceled orders automatically.

    2. Hi, thanks for the reply.
      The manual edit working fine, but the “recalculate data” does not skip the cancelled order, not change the purchase limit.
      Thanks.

    3. Sorry, I meant “Delete & recalculate sales data” tool.

    4. it will not delete previous purchase limit?
      can i solve this somehow automated? I have 4-5 orders a day that are canceled, manual edit take a lot of time.
      Thank you

    5. Well, it will delete data, but after that it will go through all the orders in your system, and recount all data (while skipping the canceled orders), so it all should be ok after the tool finishes. I could add an option to make this tool recurring/automated, but to be honest, I don’t think it’s the right way – it will go through all your orders again and again, and this will take too much unnecessary resources. Please give me a couple of days or so to implement it correctly, i.e. by adding special action when some order is canceled.

    6. Thank you so much!

  8. Is it possible to set the %first_order_date_exp_timeleft% to be a date and time instead of weeks. I have the time frame set for 30 days, and when I set the message to show time left it says “4 weeks” instead of the actual date that it will allow for more ordering.

    1. Hi Jacob,

      Currently %first_order_date_exp_timeleft% is using human_time_diff() function to display the time, so it will automatically start decreasing time units when the time will get closer to zero, i.e. “2 days”, “1 hour”, “5 mins”. Let me know if you want to make it always display in the same format (e.g. days), and I will add it in the next plugin version.

      Also, not sure if you really need it, but you can display the actual date with %first_order_date_exp% (i.e. vs %first_order_date_exp_timeleft%).

  9. I have set a limit 4 for each product but some customer have buy more then 4.
    Please can help me?
    The plugin is enabled and I have set:
    General Options => product quantities.
    Limits => enable for all – max 4 per user.
    Fronted => Block checkout page enabled
    …but some customer have buy more then 4 …how is possible?

    1. Hi Alfonso,

      First thing that comes to mind – please make sure that you have selected the right order statuses in the “Order statuses” option in the “General” section (in “WooCommerce > Settings > Maximum Products per User > General”) – by default it’s set to count “Completed” orders only.

      Please let me know if that doesn’t help.

  10. Is it possible to limit the amount of total products a user can purchase in a certain time frame? I was able to limit a product to max out at 1 purchase (so no one bought duplicate products), but I would like to limit each user to a maximum of 3 products per month. Is it possible with the free version? Is it possible with the paid version?

    Thanks!

    1. Hi Jacob,

      Sorry for the late reply.

      This can be done with our plugin, however, you will need to: a) add a small PHP snippet to your (child) theme’s functions.php file, and b) assign all your products to some category or tag.

      If that’s good enough – here is what you need to do:

      1. To limit the total number of products to 3 – as mentioned, you need to assign all your products to some category or tag. After that you need to enable “Per product category” (or “Per product tag”) option in “WooCommerce > Settings > Maximum Products per User > Limits”, and then set “Limit per user” option for that category (or tag) (in “Products > Categories > Your category > Edit”) to “3”. Unfortunately, “Per product category” (and “Per product tag”) options are available in Pro version only.

      And, as you want this monthly, you need to set the “Date range” option (in “WooCommerce > Settings > Maximum Products per User > General”) to “This month” or “Last 30 days” (depending if you want it to be counted from the 1st of the current month, or in last 30 days).

      2. Now to add an additional “one product only” requirement, you will need to add this snippet:

      add_filter( 'alg_wc_mppu_check_quantities_for_product', 'my_alg_wc_mppu_limit_all_products_to_one', 10, 3 );
      if ( ! function_exists( 'my_alg_wc_mppu_limit_all_products_to_one' ) ) {
          /**
           * Sets max quantity for all products to one.
           */
          function my_alg_wc_mppu_limit_all_products_to_one( $is_valid, $core, $args ) {
              if ( $is_valid ) {
                  $max_qty_all_products = 1;
                  $bought_data          = $core->get_user_already_bought_qty( $args['product_id'], $args['current_user_id'], true );
                  $user_already_bought  = $bought_data['bought'];
                  if ( ( $user_already_bought + $args['cart_item_quantity'] ) > $max_qty_all_products ) {
                      if ( $args['do_add_notices'] ) {
                          $core->output_notice( $args['product_id'], $max_qty_all_products, $bought_data, $args['is_cart'], $args['cart_item_quantity'], 0 );
                      }
                      return false;
                  }
              }
              return $is_valid;
          }
      }
      

      Please give it a try and let me know if you have any questions.

  11. Hi tom
    I’ve set the formula for membership slugs to max quantities however members can still add unlimited products to cart.

    John

    1. If anyone else has a similar question – the problem was in wrong quote symbols in shortcodes.

  12. I have set limit to “product price” result page it shows as “pcs” instead of currency symbol.

    1. Hi Ravi,

      Sorry for the late reply.

      Not sure if I understood you correctly, but I think what you need to do is go to “WooCommerce > Settings > Maximum Products per User > Frontend” and change the default message(s), for example to:

      You can only buy maximum $%limit% of %product_title% (you've already bought $%bought%).

      Please let me know if I misunderstood you.

    2. I have one more problem. I have set this day limit to 10000 and as per my understanding “This Day” limit is for per day limit. But the issue is the client is not able to buy product where as it was his firs buy below 10k or that day.

    3. Hi Ravi,

      Just to be sure – “This day” means today starting from 00:00. If you need it in the last day – there is “Last 24 hours” option there. If you indeed need it “This day” but it’s not working correctly – please try changing the “Time function” option in plugin’s “Advanced” settings section: if you set it to “Local (WordPress) time” it will include the timezone offset.

  13. Hi Tom

    How to Limits?
    — Each user can only purchase 5 products per day
    — Each user can only purchase 15 products per month

  14. I need to limit the total price per day.
    i.e. user only can buy products with $100 of total price per day.

    can this be done with your plugin?

    1. Hi,

      Sorry for the late reply.

      Yes, this can be done with the plugin. What you need to do is:

      1. Set the “Mode” option (in “WooCommerce > Settings > Maximum Products per User > General”) to “Product prices”.

      2. Set the “Date range” option (again in “WooCommerce > Settings > Maximum Products per User”) to “This day” or “Last 24 hours” (depending on which period do you want to check – starting from today’s 00:00, or in trailing 24 hours).

      3. Now if you want the limit to be applied to products total (i.e. different products sum should not exceed $100), you need to use a bit of workaround: you’ll need to assign all your products to some category or tag. After that you need to enable “Per product category” (or “Per product tag”) option in “WooCommerce > Settings > Maximum Products per User > Limits”, and then set “Limit per user” option for that category (or tag) (in “Products > Categories > Your category > Edit”) to the total sum, i.e. 100.

      Hope that helps. Please let me know if you have any questions.

  15. How do I make the limit apply cumulatively to 4 products total in the users cart? I set the limit to 4 for the specific user role I need it to be applied to, however they can order 4 of as many products as they want. I need it to be 4 products in total. I need this figured out as per FDA regulation on our site! prophetpremium.com. thank you!

    1. Hi,

      This can be done, however, you’ll need to assign all your products to some category or tag. After that you need to enable “Per product category” (or “Per product tag”) option in “WooCommerce > Settings > Maximum Products per User > Limits”, and then set “Limit per user” option for that category (or tag) (in “Products > Categories > Your category > Edit”) to the total number of products you need.

  16. All order sales data is processing as 7 hours ahead of the actual order time. This is causing an issue with a customer attempting to order again the next day. If they order within 7 hours of midnight they are unable to order the next day as the plugin adds 7 hours to the completion time pushing it into the next day.
    Server time, PHP time, and WordPress time are all correct.

    1. If anyone else has a similar question, as we’ve figured out on wp.org forum, this is fixed in plugin v3.2.3. You’ll need to set “Time function” option (in plugin “Advanced” settings section) to “Local (WordPress) time”.

  17. Hello!
    I would like to block guest users from purchasing a particular product.
    I already block the purchase of that product from registered users.

    1. I’m using this shortcode… But don’t work
      [alg_wc_mppu user_id=”0″ product_id =”67023, 67024, 67025, 67026, 67027, 67028, 67029, 67030,67031,67032″ limit=”0″ ]

  18. hello,

    is your product working for variations ?

    e.g i want to limit the user from buying more than 5 variation in each product.

    can i do that ?

    Regards

  19. Re: Order #39889, placed on June 10, 2020…

    I have installed the plugin on lightinnerlight.com, where we use e-commerce to take orders for FREE books.

    We want to limit

    1) no more than one instance of each product (not more than one copy of each title) order per product per user (that worked with the free version).
    2) no more than 8 products lifetime total per customer.

    The formula I set up is [alg_wc_mppu limit=”8”]

    It is not working and since I set it up we have received many orders for more than 8 products from a customer.

    I can send you screenshots of each of the settings or give you WP-admin access. I got a lifetime liscense and appreciate your help in getting starting using this plugin.

  20. Hello

    I need to find a plugin that let me:
    – Limit the buy to 3 products and that the total of the purchase will not be more than some value, example: US $250.

    Can do that with this plugin?

  21. Hello, is it possible to set maximum products per package and not user. I am using the WP Paid Listing plugin that allows to create listing packages.

    Thank you in advance for an answer.

    Best,
    Adam Gaik

  22. Making a new thread as we solved nearly everything writing custom code.
    Only thing left is to limit per user group.

    The question remains, what table do we need to update if we are using limitations based on tag;
    [alg_wc_mppu_max_qty max_qty=”15″ user_role=”member-fs” term_id=”map”]
    [alg_wc_mppu_max_qty max_qty=”8″ user_id=”customer” term_id=”map”]
    (and what checkboxes do we need to check to have the plugin only use these formulas?)

    We really need a fast answer for this.

    Thank you

    1. And disregard that… We got it working with custom code and a groups plugin

  23. Hi,

    I bought the pro version. I use the Woocommerce Event Manager plugin, there are events and categories in it. You can buy tickets for the event through the Woocommerce store, like a product.
    I use three event category, and three membership plan (Woocommerce membership plugin), and i want to limit the booking quantity for the membership plans.
    Is there any possibility, to filter not by product category but by event category?
    In this plugin, the event category id is “mep_cat”.
    Thank you!

    1. Did anyone get this working to limit amount purchased in a category? I would love to see what you did!???

  24. Do you have any suggestions for creating a rule that is based on the State? ie. 1 product per user in New York. Any advice on how to approach this would be amazing. This may be useful to many shops that operate in highly regulated industries as compliance often varies by state.

  25. I’ve recently downloaded the paid version of your plug in. I am able to use the plug in to physically limit the purchase of an item, however I would like a message to appear when the user tries to add this product to the cart.

    I have your default language of ” You can only buy maximum %limit% of %product_title% (you’ve already bought %bought%). “in the “front end –> customer message”.

    When I go to test this functionality as a fake user, the user is not able to add this item to the cart (which is correct), however a small black square / bar with a red/orange bar inside of it appears at the bottom of the screen. It looks like a message is trying to display, but is having some issue.

    Please let me know your thoughts.
    Thanks,
    Brandon

  26. Hello:

    I have a question about the “Maximum Products per User for WooCommerce” plugin

    I’m creating an online store for downloadable products. The products can be downloaded for free but I would like to be able to limit the number of downloads of a single product for a single customer.

    That is, the customer can download a product once but can download products that he has not bought before.

    Can you do it with this plugin?

    A greeting

    1. Hello:

      I bought the plug-in but I can’t get it to work the way I want it to.

      I’ll explain what I want to achieve and send a screenshot with the configuration:
      I have an online shop where all products are downloadable and with a price of 0. What I want to achieve is that only registered users can download 3 products monthly and that each product can be downloaded once during that period.

      However, in the orders it allows to add more than 3 products when they make a purchase.

      https://www.evernote.com/shard/s517/sh/31bf785a-0b09-067e-d86d-9edec55b1d57/41e73afcb8e4771d7e70dc7ac467df69

    2. Hi Carlos,

      Sorry for the late reply.

      This can be done with our plugin, however, you will need to: a) add a small PHP snippet to your (child) theme’s functions.php file, and b) assign all your products to some category or tag.

      If that’s good enough – here is what you need to do:

      1. To limit the total number of products to 3 – as mentioned, you need to assign all your products to some category or tag. After that you need to enable “Per product category” (or “Per product tag”) option in “WooCommerce > Settings > Maximum Products per User > Limits”, and then set “Limit per user” option for that category (or tag) (in “Products > Categories > Your category > Edit”) to “3”.

      2. Now to add an additional “one product only” requirement, you will need to add this snippet:

      add_filter( 'alg_wc_mppu_check_quantities_for_product', 'my_alg_wc_mppu_limit_all_products_to_one', 10, 3 );
      if ( ! function_exists( 'my_alg_wc_mppu_limit_all_products_to_one' ) ) {
          /**
           * Sets max quantity for all products to one.
           */
          function my_alg_wc_mppu_limit_all_products_to_one( $is_valid, $core, $args ) {
              if ( $is_valid ) {
                  $max_qty_all_products = 1;
                  $user_already_bought  = $core->get_user_already_bought_qty( $args['product_id'], $args['current_user_id'], true );
                  if ( ( $user_already_bought + $args['cart_item_quantity'] ) > $max_qty_all_products ) {
                      if ( $args['do_add_notices'] ) {
                          $core->output_notice( $args['product_id'], $max_qty_all_products, $user_already_bought, $args['is_cart'], $args['cart_item_quantity'], 0 );
                      }
                      return false;
                  }
              }
              return $is_valid;
          }
      }
      

      Please give it a try and let me know if you have any questions.

  27. Presale question:

    i have a membership website for food (woocommerce membership plugin), i study the plugin free version and im good to have code to .php etc…

    what i need this plugin to do for me (if he do):

    if regular or no member can’t buy anything.
    if gold member can buy only 70 product per month (stop if membership do not renew, but can buy the rest of quantity and or get the rest of the quantity for the next month)
    if silver member can buy only 60 product per month (stop if membership do not renew, but can buy the rest of quantity and or get the rest of the quantity for the next month)
    if bronze member can buy only 45 product per month (stop if membership do not renew, but can buy the rest of quantity and or get the rest of the quantity for the next month)

    now its for all product category gold and let said if you buy as a gold member
    5 product A
    2 product B
    you have 63 product to buy left this month
    but if you try to buy 70 you can’t.

    for the free version the product do not update in the page of Product limits or the page product itself so you cant buy as much as you can no restriction (bug?) i know its a lot and i’m sorry.

    thank you.

    1. Hi, i just buy the plugin, but i still have this bug:

      Product Remaining Bought Max
      a 70 0 70

      no matter if i buy the product bought stay at 0. 🙂

      thank you

    2. i just find the problem the gateway payment 🙂

  28. Is there a list all of possible shortcodes and placeholders?

    I want to display the customer’s total weight of a current product tag in their cart and how much is are remaining based on cart contents versus how much they’ve purchased.

    Is there a way to show the remaining weight allowed of their limit in the cart instead of only after an order is submitted?

    This would help users know how much more they can add to their cart not only how much they’ve already purchased and can purchase.

    Right now it just tells them they can’t add more to their cart if their trying to add an arbitrary amount over the limit. “You’ve added your limit of this product type to your cart.” I want to show the customers after they add to cart how much more they can add of each product type.

    1. Help would be appreciated. I feel like this plugin should show how much remaining quantity the customer CAN add to their cart not just what’s there already.

  29. Hi Tom,
    This looks amazing! One question before I buy a lifetime subscription — if I limit a user to buying say 250 downloads per month on a flat subscription price, is there a way to get the data and apply commissions to vendors for each of the various downloads the client downloaded while on the subscription?

    1. Hi Brandon,

      Thank you.

      Not sure if I understood you correctly. Our plugin does not cover any vendor functionality, however, if you need to get each user’s sales data (i.e. when and which products did he buy), then, yes, that is possible. I assume you’d need that in PHP?

      Please let me know if I misunderstood you.

  30. Hi guys – this is great. I purchased the lifetime access. Can you also add the ability to limit guests as well? I found another plugin that limits quantity per product per order. Would be good to have it in your plugin so I just need one. Bonus if we can limit quantity per product per order over a specified time range as well, but because they are guests it might be hard to enforce the time range – maybe latch to a user email or shipping address? Let me know – this would be excellent!

    1. Hi Michael,

      Sorry for the late reply.

      1. Limiting guests – as you’ve probably noticed, for the moment we only have “Block guests” option. The idea of limiting it by email sounds interesting, but it may be quite complicated to implement, as now our plugin stores sales data in each user’s meta, and as for guest there is no user in DB and thus no meta, we will have to store sales data differently for them. Anyway, I will have to look into it further – will get back to you asap. By the way, if we are going to limit it per email, it would be probably a good idea to verify user emails with e.g. Email Verification for WooCommerce plugin.

      2. Limiting per order – these two plugins should cover “per product” and “per order” functionality:
      * Product Quantity for WooCommerce
      * Order Minimum/Maximum Amount for WooCommerce
      I understand that installing one plugin is always better than two (or even three), but to be honest, I’m not sure if I want to add it to the plugin. Again, I will have to think this through.

  31. Hi. Bought the pro version. Excellent plugin. One stupid question. I assume ‘weekly’ means per 7 days based on server date, not per actual calendar week?

    I just don’t want users to think their limits are reset as soon as they enter a different calendar week.

    1. Hi,

      Thank you.

      If you mean “This week” – it does actually mean calendar week starting from Monday (you are the second person who is asking about that, so we’ll definitely add some explanation note to the settings in the next plugin version). If you need 7 previous days (i.e. 168 hours), then you need to select the “Last 7 days” option.

      Hope that helps. Please let me know if you have any questions, or if I misunderstood your question.

  32. Dear all,

    I was wondering if we can use this plugin (pro version) in the following setting;
    – a member from user group A may buy maximum 8 in quantity regardless of product
    – a member from user group B may buy up to 15 in quantity with free shipping, afterwards shipping is applies
    – both reset yearly

    Thank you.

    Kind regards

    1. Hi David,

      It can be done, however, without the free shipping requirement. At the moment, our plugin does not deal with shipping in any way. Let me try to check if I can add it to the plugin though. Will get back to you asap.

    2. Dear Tom,

      Do you have any feedback on this? Also, how would we go about limiting per user group?
      On another note, is it also possible to limit per address or custom field (aka company)?

      Thank you

    3. I forgot to ask, but it seems that you can’t set a global limit but only a limit per product? We need to be able to set a global limit (so max 15 regardless of which product they bought). Am I just setting something incorrect?

    4. Dear Tom,

      We used the term functionality to be able to globally limit purchases but have another question.

      Here an overview of current questions;
      – Can we limit per (shipping)address or another field (like Company)?
      – Can we apply free shipping below a threshold (per user group) or completely block them (another user group)
      – Can we redirect to a different page then the product page when triggering the error?

      Thank you

    5. Dear Tom,

      Sorry to post yet again (an edit feature would be nice…).

      Regarding:
      – Can we redirect to a different page then the product page when triggering the error?
      Seems to be an issue unrelated to your plugin so you can ignore that.

      But can you please fix the multiple notifications that a user can only purchase X amount of items if the products are from the same tag? We now have one notification for each product in the cart when the combined total exceeds the limit.

      Thank you.

  33. Hello,
    is there an option to cancel/end/cease a subscription/membership plan after the user consumed all maximum products tied for a membership plan/subscription ?
    I.e. a gym site offers subscription plans with fixed amount of lessons, the user then can book this lessons anytime via wc booking, and when he consume all the lessons the subscription ends.
    Many thanks.
    NK

    1. Hi Nikita,

      Unfortunately, currently, there is no option to cancel the membership, but (and I’m not completely sure that this is what you need) there is an “Example #2” snippet the “Developers” tab – it doesn’t end the subscription, however, it ties maximum products (start date) check with user’s membership subscription start date.

      Please let me know if that’s not what you are looking for.

    2. Yes, I think it will be an ideal solution.
      What length should I set for the duration of the woocommerce membership plan ?
      Also, is it possible to use a similar approach with woocommerce subscriptions ?
      Thanks

    3. Hi Nikita,

      > What length should I set for the duration of the woocommerce membership plan ?
      – You can set it to any length, except “Lifetime”.

      > Also, is it possible to use a similar approach with woocommerce subscriptions ?
      – Yes, sure. We just need to check how to get subscription’s start date with PHP.

  34. I used this formula – [alg_wc_mppu_max_qty max_qty=”3″ product_id=”1604,1592,1595,1598″]- to limit the quantity a single customer can buy from the website. I doesn’t seem to work

    1. Hi,

      Sorry for the late reply.

      A couple of things to check:

      1. Please make sure that you have enabled the “Per Product” checkbox in “Quantities” section (in “WooCommerce > Settings > Maximum Products per User > Quantities”) – this is needed to use product_id attribute in Formula.

      2. Please make sure that you have selected the right order statuses in the “Order statuses” option in the “General” section (in “WooCommerce > Settings > Maximum Products per User > General”) – by default it’s set to count “Completed” order only.

      If that doesn’t help – if you wish, you can share an admin account to your site, usually it’s the fastest way of solving such issues (my email is [email protected]). Please let me know if sharing an account is not an option, and I will continue solving this remotely.

    2. Hi I just realised that to make this plug in work, customers will have to create an account and log in. Is there any way that our customers don’t have to make an account and this plug in still works?

    3. Hi,

      Yes, the plugin needs to identify a user somehow. Not sure if this will be good enough, but if you go to “WooCommerce > Settings > Accounts & Privacy” and:

      1. disable “Allow customers to place orders without an account” checkbox,
      2. enable “When creating an account, automatically generate an account username for the customer based on their name, surname or email” checkbox,
      3. enable “When creating an account, automatically generate an account password” checkbox,

      you should see no changes on your checkout frontend, while for each customer there will be automatically created WP user – that would solve it for our plugin then. Please let me know what you think.

  35. Hi Tom,

    I think I screwed up the install. I had added the product successfully without the Pro option, right from WP. Then I bought the upgrade and followed your instructions of dropping the folder in the directory. Now it shows only the baseline version, it’s not Pro. What should I do?

    Thanks,
    Chris

    1. … I am on a Staging site, I think I added the folder only to Production. Checking.

    2. … Nevermind, fixed. Support showed how to update Staging, works fine. SOrry to bother you.

    3. Hi Chris,

      I would recommend installing the plugin by uploading zip file via “Plugins > Add New > Upload Plugin” from your WP dashboard (i.e. not via FTP). Anyway, glad to hear you’ve figured it out. Please let me know if you have any more questions.

  36. Hi Tom,
    i need to use different time range for different product. It’s possible?

    1. Hi Giacomo,

      This is possible, however, you would need to add a small PHP snippet to your (child) theme’s functions.php file. For example, to set custom date range (lifetime) for product ID 100:

      add_filter( 'alg_wc_mppu_date_range', 'my_custom_alg_wc_mppu_date_range', 10, 3 );
      function my_custom_alg_wc_mppu_date_range( $date_range, $product_or_term_id, $is_product ) {
          // possible date range values are: 'lifetime', 'this_hour', 'this_day', 'this_week', 'this_month', 'this_year', 'last_hour', 'last_24_hours', 'last_7_days', 'last_30_days', 'last_365_days', 'custom'
          return ( $is_product && 100 == $product_or_term_id ? 'lifetime' : $date_range );
      }
      

      I hope this helps. Please let me know if you have any questions.

    2. Thanks.
      And if i nee to set more than 1 custom code? How i need to change it?

    3. Hi Giacomo,

      Do you mean that you want to set different date range for more than one product? If that’s the case, here it is:

      add_filter( 'alg_wc_mppu_date_range', 'my_custom_alg_wc_mppu_date_range', 10, 3 );
      function my_custom_alg_wc_mppu_date_range( $date_range, $product_or_term_id, $is_product ) {
          // possible `$date_range` values are: 'lifetime', 'this_hour', 'this_day', 'this_week', 'this_month', 'this_year', 'last_hour', 'last_24_hours', 'last_7_days', 'last_30_days', 'last_365_days', 'custom'
          $product_date_range = array(
              100 => 'lifetime',
              110 => 'this_year',
              // TODO: here you can add more date range per product values, in "product_id => date_range" format
          );
          return ( $is_product && isset( $product_date_range[ $product_or_term_id ] ) ? $product_date_range[ $product_or_term_id ] : $date_range );
      }
      
  37. Hello,

    I bought the plugin and all is working fine so far.
    I have used the Formula ( [alg_wc_mppu_max_qty max_qty=”72″ user_id=”8″ product_id=”31897″] ) and more variations in the shop that works excellent.
    But is there a possibility to show front end for the user how many products they can still buy?

    1. Hi Katrien,

      For the moment, the only way a customer can see how many products he can still buy, is via the “Customer message” option in “WooCommerce > Settings > Maximum Products per User > Frontend”. However, I’m already working on adding 2 new options to the plugin: “Permanent notice” (on the single product page) and new “Quantities” tab in the “My Account” section. I will be releasing the new plugin version in the next few days.

    2. Hi Katrien,

      As promised, we’ve released new plugin v2.5.0 today, where I’ve added new options to display remaining, maximum, etc. quantity to the user on the frontend. So you have 3 new options:

      1. “Permanent notice” option in “WooCommerce > Settings > Maximum Products per User > Frontend” – this will display info for the current product on the single product page. You can also customize the notice text.

      2. “Quantities” tab on the “My Account” page (again in “WooCommerce > Settings > Maximum Products per User > Frontend”) – this will display quantities table for all products.

      3. [alg_wc_mppu_user_product_quantities] shortcode – this will output the same data as in the “Quantities” tab on the “My Account” page, however, you can use this shortcode anywhere on your site.

      Please let me know if something is not working as expected or if you have any questions or suggestions.

      And if you like the plugin, please consider leaving me a rating.

  38. Hi, pre-sale question,

    We are using WooCommerce Subscriptions and WooCommerce Memberships for a private store, so only members can purchase products. We have 3 different monthly memberships, is it possible with this plugin to make products in a category sellable only a maximun number of times per membership?

    So for example, subscribers to Silver membership can buy a maximun of 10 products from X category (the rest of the products can be bought normally) and subscribers to Gold membership can buy up to 15 products of that category.
    After one month (as they are monthly memberships) subscribers should be able to buy again those products up to the maximun allowed by their membership.

    Is this possible with your plugin?

    Thank you for your time

    Gabriel

    1. Hi Gabriel,

      Yes, the plugin can do that. What you need is to use “Formula” settings section (“WooCommerce > Settings > Maximum Products per User > Formula”) and set the “Formula” option there to something like this:

      [alg_wc_mppu_max_qty max_qty="10" membership_plan="silver" term_id="101"]
      [alg_wc_mppu_max_qty max_qty="15" membership_plan="gold" term_id="101"]
      

      As for resetting bought quantities on a monthly basis – you need to set “Date range” option in “General” settings section (“WooCommerce > Settings > Maximum Products per User > General”) to “Last 30 days” (or possibly “This month” if you want quantities to reset on the first day of each month instead of after 30 days).

      Hope that clears it up. Please let me know if you have any questions.

    2. Hello Tom,

      Ive purchased the plugin and it works great. My only question is with the date range. Ive set it on “last 30 days”, but when does it start counting? Is it possible to have it tied to the moment the user bought the subscription? So they have 30 days from that moment to make the purchase.

      Thank you!

    3. Hi Gabriel,

      When you set the date range to “Last 30 days”, the plugin will check all orders from the last 30 days from the current moment (i.e. from the moment customer tries to buy a new product). As I understand, you need something different, i.e. the plugin should check if 30 days have passed since the customer bought a subscription and if so then apply zero max quantity for the product, is that correct? If that’s the case, I will have to check on how can I implement it in the plugin.

      P.S. Thank you for the purchase.

    4. Hi Tom,

      yes, as the subscriptions last for one month (as well as the memberships, their lenght is tied to the subscription’s length) the idea would be that the max quantities allowed to buy would also be tied to that time, so a month after purchasing the subscription/membership in this case.
      As the subscription is autorenewed every month, if the user doesnt cancel it then he would be able to buy again the products for another month (to the max allowed in the formula as usual).

      Let me know if this would be possible,
      thank you!

    5. Hi Gabriel,

      Ok, I think I got it this time. Please give me a couple of days to get back to you.

    6. Hi Gabriel,

      I was thinking about your task and I think I have a solution.

      First of all, we should set Formula to something like this:

      [alg_wc_mppu_max_qty max_qty="10" membership_plan="silver" term_id="101"]
      [alg_wc_mppu_max_qty max_qty="15" membership_plan="gold" term_id="102"]
      [alg_wc_mppu_max_qty max_qty="-1" term_id="101,102"]
      

      This way users with active memberships will be able to order maximum 10 and 15 products depending on their membership plan. And users with no active membership will be restricted from buying any products at all (i.e. max quantity -1).

      Now if you set “Date range” to “Last 30 days”, the only problem we now have is that when checking orders for quantities, the plugin may check too many orders, i.e. orders from previous subscription. To fix that we will need to use alg_wc_mppu_date_to_check filter available in the plugin. Unfortunately, I don’t have “WooCommerce Memberships” plugin on my server, so I can’t give you the exact code, but if I could log in to your server (with FTP), I should be able to do it (if that’s possible my email is [email protected]). Or you can try to test it yourself with the code below. Generally the filter can be used to define custom date range, i.e.:

      add_filter( 'alg_wc_mppu_date_to_check', 'my_alg_wc_mppu_date_to_check', 10, 3 );
      if ( ! function_exists( 'my_alg_wc_mppu_date_to_check' ) ) {
          /**
           * Maximum Products per User: Sets "date to check" to current user's membership start date.
           */
          function my_alg_wc_mppu_date_to_check( $date_to_check, $date_range, $current_time ) {
              foreach ( wc_memberships_get_membership_plans() as $membership_plan_id => $membership_plan ) {
                  if ( wc_memberships_is_user_active_member( get_current_user_id(), $membership_plan_id ) ) {
                      $user_membership = wc_memberships()->get_user_memberships_instance()->get_user_membership( get_current_user_id(), $membership_plan_id );
                      $date_to_check   = get_post_modified_time( 'U', false, $user_membership->post );
                      if ( ! $date_to_check ) {
                          $date_to_check = $user_membership->get_start_date( 'timestamp' ); // Fallback
                      }
                      return $date_to_check;
                  }
              }
              return $date_to_check;
          }
      }
      

      Please let me know what you think.

  39. Hi there, Pre-sale question

    Is it possible to set this so that we limit the amount of products a user with a certain role can purchase during 1 month? So basically I want to give some users a unique role and limit those users to only purchase 3 products per month, regardless of the product. Right now, the way I see it working is that it limits the purchases on a single product but not all the products, for instance if someone is purchasing a book, they can only purchase that specific book 3 times and no more, but I want it so that they can only purchase 3 products as a whole regardless of which product they want to purchase.

    Not sure if that makes sense. Please let me know. Thank you!

    1. Hi Guillermo,

      If I understood you correctly – possible solution would be to group your products in some product category or tag and then use “Per product category” or “Per product tag” option (in “WooCommerce > Settings > Maximum Products per User > Quantities > Per Product Taxonomy”). Please let me know if that’s good enough or if I misunderstood you.

  40. Is it possible to limit the customers order to 1 product per category but allow him to order as many quantities as he wants?

    Thank you

    1. Hi Jonas,

      Unfortunately, no – currently the plugin will require you to set max quantity for the product, so the closest solution would be to set max quantity to 1 for the category, i.e. customers will be able to buy only one product per category, but the quantity has also to be 1. Let me check if I can implement your task in the plugin. I will get back to you as soon as I can.

  41. Hello,

    I’m looking to limit max products based on their “Membership Plans” for the year.
    I’ve got your PRO version and I use “Max Quantity by Formula”

    [alg_wc_mppu_max_qty max_qty=”4″ membership_plan=”Family Membership 2020 (#273)”]
    [alg_wc_mppu_max_qty max_qty=”2″ membership_plan=”couple-membership-2020″]
    [alg_wc_mppu_max_qty max_qty=”1″ membership_plan=”student-membership-2020″]

    It’s not working. Am I missing something?

    1. Hi,

      Maybe it’s possible to share an admin account to your site, so I could log in and check what’s going on (my email is [email protected])? If sharing an account is not an option – let me know and I will solve this remotely.

    2. Done! I’ve created the account for you my site (GCAOttawa.ca).
      Thank you!

    3. Hi,

      I’ve just logged in to your site.

      1. You need to use membership plan slug instead of title, so I’ve replaced “Family Membership 2020 (#273)” with “student-membership-2020” in “Formula”.

      2. Please note that you have set quantities to be updated only when order is “Completed” (in “Order statuses” option in “General” plugin settings section).

      Please let me know if that solves it. If not – I will continue investigating. And in this case – maybe you have some test user assigned to some membership plan, so I could login as this user and test it?

    4. Hello Tom,

      Thank you for the response back.
      1. I will use the membership plan slug. <– I really needed to know this.
      2. I believe that the setting is correct.

      I am testing it with a product "test-sample-ticket". My user account is part of the "family-membership-2020" plan has been able to buy more than the 4 allowed.
      Should I change the settings in your point 2?

      I don't want the members to be able to add more in their cart after their maximum. Am I missing something?

    5. If anyone else has a similar issue – we’ve discovered a bug today – you need to enable one of the checkboxes in the “Quantities” section for “Formula” to become active. We will be releasing the fix as soon as possible, meanwhile, you can simply enable e.g. “Per product” checkbox (in “WooCommerce > Settings > Maximum Products per User > Quantities”). If you won’t then set any actual max quantities on the product edit pages, this checkbox won’t have any other effect, except fixing it, i.e. making “Formula” active.

    6. Just wanted to let you know – this is now fixed in plugin v2.4.3 – i.e. it’s no longer required to have any of the “Quantities” checkboxes enabled for “Formula” to be active.

  42. We have a golf academy website, and we’re using WooCommerce Subscriptions, Bookings, and Memberships. I just purchased this plugin, and I need to set up a membership so that it only allows 1 (bookable) golf lesson per month. I have another type of membership that allows 2 (bookable) lessons per month.

    The member has the option to buy more lessons each month if they’d like but at a discounted rate. Just trying to figure out how to use your plugin to allow the to book only 1 or 2 lessons per month depending on membership type.

    Thanks in advance!
    Anne

    1. Hi Anne,

      Could you please let me know if each membership type has its own user role? Or those are not connected?

    2. It does not. I haven’t done anything with user roles, but could. Was trying to figure out how to create new roles.

    3. Ok, if you will be able to connect memberships and user roles, then you will just need to enable “User roles” checkbox in plugin settings and then set max quantities for each user role (and optionally product).

      If you won’t be able to connect it with user roles – I will have to add some code to the plugin to make it work with memberships.

    4. Hi Anne,

      We’ve released new plugin v2.4.2 today, where I’ve added new membership_plan attribute to the “Formula” section. So now you can set max quantities per membership plan (i.e. without user roles). Basically now you need to add something like this to the “Formula” option:

      [alg_wc_mppu_max_qty max_qty="2" membership_plan="silver,gold"]
      

      I.e. in this example you will set the max quantity to 2 pcs. for all users with silver or gold membership plan (you need to use membership plan slugs here).

      If you want to set different max quantities for different products, then you need to enable “Per Product” checkbox in “Quantities” section and set “Formula” to e.g.:

      [alg_wc_mppu_max_qty max_qty="2" membership_plan="silver,gold" product_id="101,102"]
      [alg_wc_mppu_max_qty max_qty="1" membership_plan="silver,gold" product_id="103,104"]
      

      Please let me know if something is not working as expected or if you have any questions.

      P.S. If you wish, you can also share an admin account to your site, so I could log in and help you with it (my email is [email protected]).

  43. Hi dear support.

    I’m using this line in formula ( pro version ) :

    [alg_wc_mppu_max_qty max_qty=”0″ user_id=”5″ product_id=”448″]

    max_qty=”0″ It is considered unlimited !

    And it is not considered zero.

    The customer can order the product indefinitely.

    How do I set the product quota for the customer to zero?

    1. Hi,

      You are correct, max_qty="0" means that there are no restrictions for max quantity for that user. To set it to zero, you need to set max quantity to -1, i.e.:

      [alg_wc_mppu_max_qty max_qty="-1" user_id="5" product_id="448"]
  44. Hello,
    I’ve just tested your free version of the plugin and it worked fine.
    I have a question before proceeding to buy the pro version.
    Is it possible to limit the user to just one order in the time period?
    I think that it would work if I put my products in a specific category and limit the users by the category.
    I appreciate it if you confirm the needed functionality before purchasing the pro version.

    1. Hi Amin,

      Yes, that is possible. What you need to do is enable “Per product category” checkbox in “WooCommerce > Settings > Maximum Products per User > Quantities”. Then you need to go to some category in “Products > Categories > Edit category” and set “Maximum quantity per user” to 1 there.

    2. Is it possible to send me a limited license? One or two days is enough in order to validate the functionality adaptation.

  45. Hi
    is your plugin compatible with WooCommerce Wholesale Prices Premium ?
    Regards,
    Gaël

    1. Hi Gaël,

      To be honest, I didn’t test it with the “WooCommerce Wholesale Prices Premium” plugin, however, as our plugin doesn’t change product prices, I believe there should be no issues. Also, if something won’t work correctly, just let me know and I will fix it asap.

  46. Hi,
    Presale question: Will I be able to limit the maximum amount of products on a per user role basis for each product individually with this plugin?
    My site has many user roles and I must restrict how many items of a given product each user role will be able to acquire.
    I can see the free version does this but globally for all products. I must have this option enabled for individual products.
    Looking forward to your reply.

    1. Hi Robin,

      Yes, this is exactly what Pro version has – you will be able to set each user role’s quantities for each product individually.

      Hope that helps and please let me know if you have any questions.

    2. P.S. I’ve just added “Per product + User roles” screenshot to the plugin description.

    3. Thank you for your help, Tom.
      My final question before purchase would be: Is the plugin WooCommerce REST API-friendly?
      Many of the traits that make up my site are made with the REST API and I necessarily must have all plugin options be made available through this feature.
      Looking forward to your reply.

    4. There should be no issues with WooCommerce REST API, however, if something will not work correctly, I’m ready to help/fix.

  47. I’ve just purchased the pro plugin – I want to set it so that just one of my (many) products are restricted to one per user lifetime…. I don’t see a setting for that anywhere. What am I missing?

    1. Hi Ian,

      First you need to enable “Per product” checkbox in “WooCommerce > Settings > Maximum Products per User > Quantities”. After that you have two options:

      1. Go to some product’s admin edit page, locate the “Maximum Products per User” meta box and set max quantity there.

      2. Use new “Formula” feature that we’ve added just yesterday: go to “WooCommerce > Settings > Maximum Products per User > Formula”, enable the section and set “Formula” to something like this:

      [alg_wc_mppu_max_qty max_qty="10" product_id="100"]
      

      Here you need to replace 100 with your actual product ID(s) and 10 with desired max quantity.

      Hope that helps and please let me know if you have any questions.

  48. Hello, I have bought the pro version and the “per product” function does not work. The other “all products” that was in the free version was working fine. I need your support to make this work please.

    1. Hi,

      Sorry for the late reply. Would it be possible for me to log in to your site’s admin – usually it’s the fastest way of solving such issues. If yes – my email is [email protected]inder.me

  49. Hello sorry I just want to confirm if I can also set up max to specific user regardless of role such as “user A” has a total of 10 apples a month but “user B” can buy 20 a month when both are subscribers

    1. Hi John,

      Unfortunately no – currently max quantity can be set per user role only (or for all users at once). However, I was already thinking about adding per user options, so I’m going to add it in the next plugin version. I’m planning to release it right after the weekend, on Monday or Tuesday.

    2. Hi John,

      It took me a little longer than expected, but I’ve finally managed to add max quantity on per user basis to the plugin.

      I’ve implemented it a bit differently this time. In new v2.3.0 I’ve added new “Formula” section to the plugin settings (in “WooCommerce > Settings > Maximum Products per User > Formula”). After enabling this section, you need to set “Formula” option to something like this:

      [alg_wc_mppu_max_qty max_qty="10" user_id="1"]
      [alg_wc_mppu_max_qty max_qty="20" user_id="2"]
      

      Here you need to replace 1 with the actual user ID of “user A”, and 2 with user ID of “user B”.

      You can find more formula examples on the plugin settings page, for example, you can set max quantity on per user per product basis.

      Please let me know if something is not working as expected or if you have any questions.

      P.S. “Max Quantity by Formula” is available in Pro version only.

    3. Wow you are awesome! I will definitly purchase this app amazing support thanks alot

    4. Hi John,

      Happy to help 🙂 Please let me know if you need anything else.

      And thank you for the purchase!

  50. Hi,

    I would like to put a limit on my customers’ purchase per day. But the only options that are available in “Date range” section are: Lifetime, This Month, This Year, Last 30 Days, Last 365 Days.
    No DAILY option 🙁

    1. Hi,

      I’ve just checked the plugin code and it seems that adding daily option shouldn’t be too hard. Will release new plugin version shortly.

    2. Hi,

      As promised, we’ve just released a new plugin version 2.1.0, where I’ve added these new date ranges to the plugin: “This hour”, “This day”, “This week”, “Last hour”, “Last 24 hours”, “Last 7 days”.

      Please let me know if something is not working as expected or if you have any questions. And if you like the plugin, please consider leaving me a rating.

  51. Greetings — This doesn’t appear to be working; perhaps it’s a conflict with the plugin, Direct Checkout Pro? Could someone please contact me to log into my WP site to see what might be happening? Thank you — Adam Jacobi

  52. Does this work with variation products too? Can I set a maximum purchase limit on a variation but allow other variations of the same product to also be purchased?

    1. Hi Kim,

      Sorry for a late reply.

      Yes, since plugin version 2.0.0 you can set maximum quantity on per variation basis. You need to enable “Use variations” option in plugin’s settings (in “WooCommerce > Settings > Maximum Products per User > General”).

      Hope that helps. Please let me know if you have any questions.

  53. Hi There,

    I’ve just installed and activated the plugin. It is showing on the product page and I have selected the max products per user but when I preview the product it has removed the delegate booking info which are fields added by woocommerce box office plugin and instead I see the following error message:

    Fatal error: Call to undefined method WC_Product_Simple::get_max_purchase_quantity() in /var/sites/y/yarlsideteachingschool.co.uk/public_html/wp-content/plugins/product-quantity-for-woocommerce-pro/includes/class-alg-wc-pq-core.php on line 476

    I use the woocommerce box office plugin to sell places on the courses we run and I’ve bought your plugin so that I could limit the maximum qty for certain courses.

    I suspect your plugin conflicts with woocommerce box office – I can’t manage without this plugin and I bought your plugin to enhance the functionality.

    Do you have any suggestions as to what I can do?

    Many thanks in advance.

    Kind Regards,

    Deb

    1. Hi Deb,

      Maybe I could log in to your server to check it out? If that’s possible – my private email is [email protected]. WP and FTP access would be perfect.

Leave a Reply

Your email address will not be published. Required fields are marked *

Changelog

3.2.5 - 23/07/2020

  • Fix - Formula - "All products" limit value was used as a fallback for the formula even if "All products" option was disabled. This is fixed now.
  • Dev - Frontend - "Multiple notices" option added.

3.2.4 - 21/07/2020

  • Fix - Taxonomy filters fixed.
  • Dev - Code refactoring.

3.2.3 - 11/07/2020

  • Fix - Converting order date according to "Advanced > Time function" option now.
  • Dev - Advanced - Time function - Options renamed ("Server time" to "Coordinated Universal Time (UTC)", and "WordPress time" to "Local (WordPress) time").
  • Dev - Formula - product_sku attribute added to the [alg_wc_mppu] shortcode.
  • Dev - Code refactoring.
  • WC tested up to: 4.3.

3.2.2 - 03/07/2020

  • Dev - Shortcodes - [alg_wc_mppu_placeholder] shortcode added.

3.2.1 - 22/06/2020

  • Dev - Frontend - Placeholders - %first_order_date_exp%, %first_order_date% - Getting date and time format from WordPress settings now (i.e. instead of hard-coded Y-m-d H:i:s).

3.2.0 - 18/06/2020

  • Dev - Frontend - Customer message (and [alg_wc_mppu_current_product_limit], [alg_wc_mppu_term_limit] shortcodes) - %first_order_date%, %first_order_amount%, %first_order_date_exp%, %first_order_date_exp_timeleft% placeholders added.
  • Dev - Frontend - Single product page - "Text in product description" option added.
  • Dev - Formula - [alg_wc_mppu] - Getting time for start_date and end_date shortcode attributes according to "Advanced > Time function" option now.
  • WC tested up to: 4.2.

3.1.1 - 22/05/2020

  • Dev - General - Block guests - Outputting message on AJAX add to cart now.
  • Dev - Frontend - Customer message - %in_cart%, %bought_plus_in_cart%, %remaining_minus_in_cart%, %adding%, %in_cart_plus_adding%, %bought_plus_in_cart_plus_adding%, %remaining_minus_in_cart_minus_adding%, %term_name% placeholders added.

3.1.0 - 08/05/2020

  • Dev - Formula - is_downloadable, is_virtual attributes added to the [alg_wc_mppu] shortcode.
  • Dev - Formula - start_date, end_date, not_date_limit attributes added to the [alg_wc_mppu] shortcode.
  • Dev - Formula - Admin settings descriptions updated.
  • Dev - [alg_wc_mppu_term_limit] shortcode added.
  • Dev - alg_wc_mppu_date_to_check filter - product_or_term_id, current_user_id and is_product params added.
  • Dev - Code refactoring.
  • WC tested up to: 4.1.

3.0.1 - 29/04/2020

  • Fix - Formula - Shortcode bug (limit attribute vs deprecated max_qty attribute) fixed.
  • Dev - Frontend - Single product page - Default message updated (from "The remaining quantity for..." to "The remaining amount for...").
  • Dev - Reports - Sales Data - Column title updated (from "Qty" to "Bought").

3.0.0 - 14/04/2020

  • Dev - General - "Mode" option added (with possible options: "Product quantities" (default), "Product prices" and "Product weights").
  • Dev - Frontend - Default values for the "Customer message" and "Single product page" messages updated (pcs. removed; placeholders changed (%max_qty% to %limit, %qty_already_bought% to %bought%, %remaining_qty% to %remaining%)).
  • Dev - Frontend - My Account - "Tab id" option added (defaults to product-limits).
  • Dev - Frontend - My Account - "Tab title" option added (defaults to Product limits).
  • Dev - Frontend - My Account - Default tab title changed from "Quantities" to "Product limits".
  • Dev - Formula - Shortcode renamed (from [alg_wc_mppu_max_qty] to [alg_wc_mppu]); max_qty attribute renamed to limit.
  • Dev - [alg_wc_mppu_user_product_quantities] shortcode renamed to [alg_wc_mppu_user_product_limits].
  • Dev - [alg_wc_mppu_current_product_quantity] shortcode renamed to [alg_wc_mppu_current_product_limit].
  • Dev - Admin settings descriptions updated ("... quantities..." changed to "... limits..." etc.). "Quantities" section renamed to "Limits".
  • Dev - "Reset settings" admin notice updated.
  • Tested up to: 5.4.

2.6.0 - 23/03/2020

  • Dev - General - "Block guests" options added.
  • Dev - Admin settings restyled and descriptions updated.
  • Dev - Minor code refactoring.

2.5.2 - 13/03/2020

  • Dev - Advanced - "Duplicate product" option added (defaults to no).
  • WC tested up to: 4.0.

2.5.1 - 05/03/2020

  • Fix - General - Payment gateways - Now checking chosen payment gateway when validating quantities (in Alg_WC_MPPU_Core::check_quantities()).
  • Dev - Frontend - "Cart notice" option added.
  • Dev - Frontend - Single product page - "Text" option added (and option renamed from "Permanent notice").
  • Dev - Frontend - Single product page - Now replacing negative max qty with zero.
  • Dev - [alg_wc_mppu_current_product_quantity] shortcode added.

2.5.0 - 28/02/2020

  • Fix - Core - get_user_already_bought_qty() - Making sure that the returned value is always numeric (i.e. returning zero instead of empty).
  • Fix - Core - alg_wc_mppu_check_quantities_for_product filter - Now applying filter to false results also.
  • Dev - Frontend - "My Account" options added.
  • Dev - Frontend - "Permanent notice" option added.
  • Dev - [alg_wc_mppu_user_product_quantities] shortcode added.
  • Dev - General - Custom date range - Default value changed to 3600 (was 1).
  • Dev - Data - alg_wc_mppu_save_quantities filter added.
  • Dev - Data - alg_wc_mppu_calculate_data_wc_get_orders_args filter added.
  • Dev - Code refactoring.

2.4.3 - 18/02/2020

  • Fix - Formula - It's no longer required to have at least one of the "Quantities" section checkboxes to be enabled for "Formula" to be active.
  • Fix - Notices - Now always using the correct product ID (i.e. variation vs main variable product ID).
  • Dev - General - "Payment gateways" option added.
  • Dev - alg_wc_mppu_check_quantities_for_product filter added.

2.4.2 - 05/02/2020

  • Dev - Formula - membership_plan shortcode attribute added.
  • Dev - alg_wc_mppu_get_cart_item_quantities filter added.
  • Dev - alg_wc_mppu_validate_on_add_to_cart_quantity filter added.
  • Dev - alg_wc_mppu_save_quantities_item_qty filter added.
  • WC tested up to: 3.9.

2.4.1 - 20/01/2020

  • Dev - Replacing negative max qty with zero in notice now.
  • Dev - Code refactoring.

2.4.0 - 28/12/2019

  • Dev - Tools - "Delete sales data" tool added.
  • Dev - Tools - Advanced - "Orders date range" option added.
  • Dev - Tools - Advanced - "Query block size" option added.
  • Dev - Tools - Advanced - "Time limit" option added.
  • Dev - Tools - Advanced - "Loop function" option added.
  • Dev - Tools - Advanced - "Debug" option added.
  • Dev - Settings - General - Section split into two separate sections ("General" and "Frontend").
  • Dev - Settings - Admin & Tools - Section split into two separate sections.
  • Dev - Code refactoring.

2.3.1 - 25/12/2019

  • Dev - General Options - Date range - "Custom" date range options added.
  • Dev - "Advanced" options section added.

2.3.0 - 13/12/2019

  • Fix - User roles - "Guest" user role removed from the lists.
  • Dev - "Formula" (i.e. "Max Quantity by Formula") section added.
  • Dev - Code refactoring.
  • Tested up to: 5.3.

2.2.0 - 10/11/2019

  • Dev - General Options - "Order statuses" option added.
  • Dev - General Options - "User roles" option added.
  • Dev - Admin Options - "Editable sales data" options added (sales data can now be edited in backend on user's edit page).
  • Dev - alg_wc_mppu_get_max_qty filter added.
  • Dev - Admin settings restyled and split into sections.
  • Dev - Code refactoring.
  • WC tested up to: 3.8.

2.1.0 - 01/10/2019

  • Dev - General Options - Date range - "This hour", "This day", "This week", "Last hour", "Last 24 hours", "Last 7 days" ranges added.
  • Dev - General Options - "Time function" option added.
  • Dev - alg_wc_mppu_date_range filter added.
  • Dev - alg_wc_mppu_date_to_check filter added.
  • WC tested up to: 3.7.

2.0.0 - 28/07/2019

  • Dev - Per Product Taxonomy - "Per product tag" option added.
  • Dev - Per Product Taxonomy - "Per product category" option added.
  • Dev - General Options - "Use variations" option added.
  • Dev - General Options - "Validate on add to cart" option added.
  • Dev - General Options - "Date range" option added.
  • Dev - General Options - "Exclude products" option added.
  • Dev - Tools - "Delete & recalculate sales data" tool added.
  • Dev - Tools - Recalculate sales data - Button replaced with checkbox.
  • Dev - [alg_wc_mppu_translate] shortcode added (for "Customer message").
  • Dev - Major code refactoring.
  • Tested up to: 5.2.

1.1.2 - 20/04/2019

  • Dev - Admin settings descriptions updated.
  • Dev - "WC tested up to" updated.

1.1.1 - 08/04/2019

  • Dev - Code refactoring.
  • Dev - Data sanitized and escaped.

1.1.0 - 22/10/2018

  • Dev - Admin settings descriptions updated.
  • Dev - Code refactoring.

1.0.0 - 18/06/2018

  • Initial Release.

Frequently Asked Questions

Q. I'm seeing No data yet text in "Maximum Products per User: Sales Data" meta box.

A. While data is recalculated automatically (but only after the plugin was enabled), you can force manual recalculation with Recalculate sales data option in the "Tools" section (in "WooCommerce > Settings > Maximum Products per User > Tools"). This is useful on initial plugin install (i.e. to calculate sales data from before the plugin was enabled). Please note that by default product quantities are updated when order status is changed to Completed.


Q. I've configured the plugin, but my customers can still finish the order with an exceeded quantities.

A. Please check what order statuses are set to be counted in "WooCommerce > Settings > Maximum Products per User > Order statuses". By default it's set to "Completed" orders only. Don't forget to "Recalculate sales data" after changing the "Order statuses" option. If that is not the case - there is "Editable sales data" option in "WooCommerce > Settings > Maximum Products per User > Admin". If you enable it and then go to some user's profile page (i.e. in "Users" menu), you will be able to see which products did this user buy - that may help to understand what's going on.


Q. My customers can reach the checkout page with an exceeded quantities (they are correctly not allowed to finish the order though).

A. Please make sure that "Block checkout page" option in checked in "WooCommerce > Settings > Maximum Products per User > Frontend".


Q. Can I limit the total number of products, i.e. set maximum limit for total number of products instead of per product.

A. Yes, this can be done, however, you'll need to assign all your products to some category or tag. After that you need to enable "Per product category" (or "Per product tag") option in "WooCommerce > Settings > Maximum Products per User > Limits", and then set "Limit per user" option for that category (or tag) (in "Products > Categories > Your category > Edit") to the total number of products you need.

Free vs Pro

This plugin is a premium version of free "Maximum Products per User for WooCommerce" plugin.

Free VersionPro Version
Mode (i.e. product quantities, prices or weights)yesyes
Date rangeyesyes
Order statusesyesyes
Payment gatewaysyesyes
Use variationsyesyes
User rolesyesyes
Validate on add to cartyesyes
Customer messageyesyes
Block checkout pageyesyes
Permanent noticeyesyes
My Accountyesyes
Editable sales datayesyes
Toolsyesyes
Exclude productsyesyes
All productsyesyes
Per product categorynoyes
Per product tagnoyes
Per individual productnoyes
By formula (e.g. per user ID; per membership plan etc.)noyes

Developers

alg_wc_mppu_date_to_check filter

You can set custom date range with "Date range" option in "General" plugin settings, however, if you need start date to be dynamic, i.e. to depend on some variable params, you can use alg_wc_mppu_date_to_check filter. Please note that for this filter to be applied, "Date range" option must not be set to "Lifetime". Date must be returned as a timestamp.

Example #1

Let's say, you want to limit max quantity based on user's membership plan. In this case, you would set "Formula" to something like this:

[alg_wc_mppu limit="3" membership_plan="silver"]
[alg_wc_mppu limit="36" membership_plan="gold"]

Now let's say, you want "silver" users to buy max 3 products per month, while "gold" users should be able to purchase max 36 products per year. in this case, you would need to set "Date range" option to "Last 365 days" (i.e. for "gold" members) and modify date range for "silver" members with the filter:

add_filter( 'alg_wc_mppu_date_to_check', 'my_alg_wc_mppu_date_to_check', 10, 3 );
if ( ! function_exists( 'my_alg_wc_mppu_date_to_check' ) ) {
    /**
     * Sets "date to check" for "silver" membership to "last 30 days".
     */
    function my_alg_wc_mppu_date_to_check( $date_to_check, $date_range, $current_time ) {
        return ( wc_memberships_is_user_active_member( get_current_user_id(), 'silver' ) ? ( $current_time - MONTH_IN_SECONDS ) : $date_to_check );
    }
}

Example #2

Let's say, you want start date to be equal to user's membership subscription start date:

add_filter( 'alg_wc_mppu_date_to_check', 'my_alg_wc_mppu_date_to_check', 10, 3 );
if ( ! function_exists( 'my_alg_wc_mppu_date_to_check' ) ) {
    /**
     * Maximum Products per User: Sets "date to check" to current user's membership start date.
     */
    function my_alg_wc_mppu_date_to_check( $date_to_check, $date_range, $current_time ) {
        foreach ( wc_memberships_get_membership_plans() as $membership_plan_id => $membership_plan ) {
            if ( wc_memberships_is_user_active_member( get_current_user_id(), $membership_plan_id ) ) {
                $user_membership = wc_memberships()->get_user_memberships_instance()->get_user_membership( get_current_user_id(), $membership_plan_id );
                $date_to_check   = get_post_modified_time( 'U', false, $user_membership->post );
                if ( ! $date_to_check ) {
                    $date_to_check = $user_membership->get_start_date( 'timestamp' ); // Fallback
                }
                return $date_to_check;
            }
        }
        return $date_to_check;
    }
}

Prices & Licenses

Single siteUnlimited sites
1 year[buy] $29.99 / year[buy] $79.99 / year
Lifetime[buy] $49.99[buy] $149.99

Installation and Updates

  • Buy the plugin 🙂
  • Download plugin's zip to your computer (you will receive an email with download link, or you can always download the plugin from your account).
  • Go to "Admin Dashboard > Plugins > Add New > Upload Plugin" and browse for downloaded zip file.
  • If plugin is successfully installed - you should see it added to the Plugins list.
  • To keep WPFactory items up to date, please install WPFactory Helper plugin and enter your site key.

Refunds

We want to ensure that you are 100% happy with your purchase, so if you feel the product(s) you purchased are not the best fit for your requirements and you attempted to resolve issues with product's author, we are offering 30 day money back guarantee refund policy.