Tested Updated Trending Perfect rating

Product Quantity for WooCommerce

(1 customer review)

From: $19.99 / year

Manage product quantity with Product Quantity for WooCommerce plugin, beautifully.

Clear

Description

Product Quantity for WooCommerce plugin lets you manage product quantities for order (i.e. cart) in WooCommerce.

You can set minimum and/or maximum product quantities in three different ways:

  • Cart total quantity – will check minimum and/or maximum quantity for all products in cart (i.e. sum of all quantities).
  • Per item quantity – will check minimum and/or maximum quantity for each product in cart. This value is applied to all products (i.e. same minimum and/or maximum quantity for each item).
  • Per item quantity on per product basis – similar to “Per item quantity”, but lets you set different minimum and/or maximum quantity for every product. Works with variable products (i.e. different quantities can be set for each variation).

Additionally you can control quantity step – for all products or on per product basis.

Product Quantity for WooCommerce plugin also includes these features:

  • enabling decimal quantities in WooCommerce,
  • replacing standard WooCommerce quantity number input with dropdown,
  • setting exact (i.e. fixed) allowed or disallowed quantities (as comma separated list),
  • validating and (optionally) correcting quantities on add to cart button click,
  • forcing initial quantity on single product page and/or archives to either min or max quantity,
  • setting quantity input style,
  • customizing messages your customer sees,
  • enabling/disabling cart notices,
  • optionally stopping customer from reaching the checkout page on wrong quantities,
  • adding product quantity info on single product and/or archive pages.

Product Quantity Options

Plugin settings are located in “WooCommerce > Settings > Product Quantity”.

Product Quantity for WooCommerce
Enabled/disables the plugin. May help if you want to configure plugin’s settings, before applying it on frontend.
Default: yes

General Options

Product Quantity for WooCommerce - General Options

Decimal quantities
Save settings after enabling this option, so you could enter decimal quantities in step, min and/or max quantity options.
Default: no
Force initial quantity on single product page
Possible values: Do not force; Force to min quantity; Force to max quantity.
Default: Do not force
Force initial quantity on archives
Possible values: Do not force; Force to min quantity; Force to max quantity.
Default: Do not force
Force minimum quantity
Will force all minimum quantities to 1. This includes cart items, grouped products etc. Ignored if “Minimum quantity” section is enabled.
Default: no
"Add to cart" validation
Possible values: Do not validate; Validate and add notices; Validate and auto-correct quantities.
Default: Do not validate
Enable cart notices
Enables/disables customer notices on the cart page.
Default: no
Block checkout page
Stops customer from reaching the checkout page on wrong quantities. Customer will be redirected to the cart page.
Default: no
On variation change (variable products)
Possible values: Do nothing; Reset to min quantity; Reset to max quantity.
Default: Do nothing
Quantity input style
Ignored if empty. E.g.: width: 100px !important; max-width: 100px !important;.
Default: None

Quantity Dropdown Options

Product Quantity for WooCommerce - Quantity Dropdown Options

Quantity as dropdown
Will replace standard WooCommerce quantity number input with dropdown. Please note that maximum quantity value must be set for the product (either via “Maximum Quantity” section or e.g. by setting maximum available product stock quantity). Also please note that currently quantity as dropdown will be disabled for variable products and it will ignore exact (i.e. fixed) quantity section settings.
Default: no
Dropdown label template: Singular
Replaced value: %qty%. For example try %qty% item
Default: %qty%
Dropdown label template: Plural
Replaced value: %qty%. For example try %qty% items
Default: %qty%

Quantity Dropdown – Frontend

Before After
Product Quantity for WooCommerce - Quantity Dropdown - Frontend - Before Product Quantity for WooCommerce - Quantity Dropdown - Frontend - After

Quantity Info Options

This section allows you to output product’s quantity info on frontend.

Product Quantity for WooCommerce - Quantity Info Options

Single product page
Adds quantity info on single product page.
Default: no
Single product page: Content
You can use HTML and/or shortcodes here. Available shortcodes: [alg_wc_pq_min_product_qty], [alg_wc_pq_max_product_qty], [alg_wc_pq_product_qty_step].
Default:
<p>[alg_wc_pq_min_product_qty before="Minimum quantity is <strong>" after="</strong><br>"][alg_wc_pq_max_product_qty before="Maximum quantity is <strong>" after="</strong><br>"][alg_wc_pq_product_qty_step before="Step is <strong>" after="</strong><br>"]</p>
Archives
Adds quantity info on archives.
Default: no
Archives: Content
You can use HTML and/or shortcodes here. Available shortcodes: [alg_wc_pq_min_product_qty], [alg_wc_pq_max_product_qty], [alg_wc_pq_product_qty_step].
Default:
<p>[alg_wc_pq_min_product_qty before="Minimum quantity is <strong>" after="</strong><br>"][alg_wc_pq_max_product_qty before="Maximum quantity is <strong>" after="</strong><br>"][alg_wc_pq_product_qty_step before="Step is <strong>" after="</strong><br>"]</p>

Quantity Info Frontend Example

Product Quantity for WooCommerce - Quantity Info - Frontend

Advanced Options

Product Quantity for WooCommerce - Advanced Options - v1.2.1

Force JS check - Quantity step (on change)
Forces JavaScript check for quantity step (on change).
Default: no
Force JS check - Quantity step (periodically)
Forces JavaScript check for quantity step (periodically).
Default: no
Force JS check - Min/max quantity (on change)
Forces JavaScript check for min/max quantity (on change).
Default: no
Force JS check - Min/max quantity (periodically)
Forces JavaScript check for min/max quantity (periodically).
Default: no

Reset Section

Reset settings
Resets section's settings to the default values.
Default: no

Minimum Quantity Options

Product Quantity for WooCommerce - Minimum Quantity Options - v1.2.1

Minimum quantity
Enables/disables minimum quantity for products.
Default: no
Cart total quantity
This will set minimum total cart quantity. Set to zero to disable.
Default: 0
Cart total quantity message
Message to be displayed to customer when minimum cart total quantity is not reached. Replaced values: %min_cart_total_quantity%, %cart_total_quantity%.
Default:
Minimum allowed order quantity is %min_cart_total_quantity%. Your current order quantity is %cart_total_quantity%.
Per item quantity - All products
This will set minimum per item quantity (for all products). Set to zero to disable.
Default: 0
Per item quantity - Per product
This will add “Product Quantity” meta box to each product’s edit page.
Default: no

Product Quantity for WooCommerce - Per Product - Minimum quantity - v1.2.1

Per item quantity message
Message to be displayed to customer when minimum per item quantity is not reached. Replaced values: %product_title%, %min_per_item_quantity%, %item_quantity%.
Default:
Minimum allowed quantity for %product_title% is %min_per_item_quantity%. Your current item quantity is %item_quantity%.

Maximum Quantity Options

Product Quantity for WooCommerce - Maximum Quantity Options - v1.2.1

Maximum quantity
Enables/disables maximum quantity for products.
Default: no
Cart total quantity
This will set maximum total cart quantity. Set to zero to disable.
Default: 0
Cart total quantity message
Message to be displayed to customer when maximum cart total quantity is exceeded. Replaced values: %max_cart_total_quantity%, %cart_total_quantity%.
Default:
Maximum allowed order quantity is %max_cart_total_quantity%. Your current order quantity is %cart_total_quantity%.
Per item quantity - All products
This will set maximum per item quantity (for all products). Set to zero to disable.
Default: 0
Per item quantity - Per product
This will add “Product Quantity” meta box to each product’s edit page.
Default: no

Product Quantity for WooCommerce - Per Product - Maximum quantity - v1.2.1

Per item quantity message
Message to be displayed to customer when maximum per item quantity is exceeded. Replaced values: %product_title%, %max_per_item_quantity%, %item_quantity%.
Default:
Maximum allowed quantity for %product_title% is %max_per_item_quantity%. Your current item quantity is %item_quantity%.

Quantity Step Options

Product Quantity for WooCommerce - Quantity Step Options

Quantity step
Enables/disables quantity step for products.
Default: no
All products
This will set quantity step for all products. Set to zero to disable.
Default: 0
Per product
This will add “Product Quantity” meta box to each product’s edit page.
Default: no
Quantity step message
Message to be displayed to customer when quantity step is incorrect. Replaced values: %product_title%, %quantity_step%, %quantity%.
Default:
Quantity step for %product_title% is %quantity_step%. Your current quantity is %quantity%.

Exact (i.e. Fixed) Quantity Options

“Fixed Quantity” settings are located in “WooCommerce > Settings > Product Quantity > Fixed Quantity”.

Product Quantity for WooCommerce - Fixed Quantity Options

Allowed quantity: Enable section
Enables/disables “Allowed quantity” section.
Default: no
Allowed quantity: All products
Allowed quantities as comma separated list, e.g.: 3,7,9. Ignored if empty.
Default: None
Allowed quantity: Per product
This will add meta box to each product’s edit page.
Default: no
Allowed quantity message
Message to be displayed to customer on wrong allowed quantities. Replaced values: %product_title%, %allowed_quantity%, %quantity%.
Default:
Allowed quantity for %product_title% is %allowed_quantity%. Your current quantity is %quantity%.
Disallowed quantity: Enable section
Enables/disables “Disallowed quantity” section.
Default: no
Disallowed quantity: All products
Disallowed quantities as comma separated list, e.g.: 3,7,9. Ignored if empty.
Default: None
Disallowed quantity: Per product
This will add meta box to each product’s edit page.
Default: no
Disallowed quantity message
Message to be displayed to customer on wrong disallowed quantities. Replaced values: %product_title%, %disallowed_quantity%, %quantity%.
Default:
Disallowed quantity for %product_title% is %disallowed_quantity%. Your current quantity is %quantity%.

1 review for Product Quantity for WooCommerce

  1. rokas

    Excellent, easy to set up and use, just perfect!

Add a review

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

56 thoughts on "Product Quantity for WooCommerce"

  1. Hello, I wish to display the quantity on the product listing. So I installed the function below that works but my “value” of “quantity” can you tell me how to run the plugin with this function? Thank you in advance and good day.

    /**
     * Add quantity field on the shop page.
     */
    function ace_shop_page_add_quantity_field() {
    	/** @var WC_Product $product */
    	$product = wc_get_product( get_the_ID() );
    	if ( ! $product->is_sold_individually() && 'variable' != $product->get_type() && $product->is_purchasable() ) {
    		woocommerce_quantity_input( array( 'min_value' => 1, 'max_value' => $product->backorders_allowed() ? '' : $product->get_stock_quantity() ) );
    	}
    }
    add_action( 'woocommerce_after_shop_loop_item', 'ace_shop_page_add_quantity_field', 12 );
    /**
     * Add required JavaScript.
     */
    function ace_shop_page_quantity_add_to_cart_handler() {
    	wc_enqueue_js( '
    		$(".woocommerce .products").on("click", ".quantity input", function() {
    			return false;
    		});
    		$(".woocommerce .products").on("change input", ".quantity .qty", function() {
    			var add_to_cart_button = $(this).parents( ".product" ).find(".add_to_cart_button");
    			// For AJAX add-to-cart actions
    			add_to_cart_button.data("quantity", $(this).val());
    			// For non-AJAX add-to-cart actions
    			add_to_cart_button.attr("href", "?add-to-cart=" + add_to_cart_button.attr("data-product_id") + "&quantity=" + $(this).val());
    		});
    		// Trigger on Enter press
    		$(".woocommerce .products").on("keypress", ".quantity .qty", function(e) {
    			if ((e.which||e.keyCode) === 13) {
    				$( this ).parents(".product").find(".add_to_cart_button").trigger("click");
    			}
    		});
    	' );
    }
    add_action( 'init', 'ace_shop_page_quantity_add_to_cart_handler' );
    
    1. Hi,

      I will have to test this, but generally, this should get you product quantities from the plugin:

      $product_id = $product->get_id();
      $default    = 1;
      $min_qty    = alg_wc_pq()->core->get_product_qty_min_max( $product_id, $default, 'min' );
      $max_qty    = alg_wc_pq()->core->get_product_qty_min_max( $product_id, $default, 'max' );
      $qty_step   = alg_wc_pq()->core->get_product_qty_step( $product_id, $default );
      

      Also – have you considered just replacing product’s add to cart form on archives with form from the single product page (in this case I believe you won’t need to add the code you’ve posted):

      remove_action( 'woocommerce_after_shop_loop_item', 'woocommerce_template_loop_add_to_cart', 10 );
      add_action( 'woocommerce_after_shop_loop_item', 'woocommerce_template_single_add_to_cart', 10 );
      

      Please let me know if this doesn’t help.

  2. Is it possible to configure quantity options with this plugin? For example, I am selling clothing and certain products come in quantities of 12,25,50,75,100,200,300. I was wondering if this plugin will override the default WooCommerce quantity selector and restrict quantity options to only the ones stated above.

    I have purchased this plugin, I just can’t seem to get my configurations to show.

    Thanks

    1. Hi Dylan,

      I believe what you need is “Fixed Quantity” section (in “WooCommerce > Settings > Product Quantity”). There is “Allowed quantity” subsection there. As you are going to set it for certain products only (i.e. not for all products at once), you also need to enable “Per product” meta box there and then set allowed quantities on each product’s admin edit page.

      Hope that helps and please let me know if you have any questions. Also, if you wish, you can share an admin account to your site so I could log in and help you set up the plugin. My private email is [email protected].

  3. hi Tom, i was wondering if we can contact you in order to make some custom changes in the plugin, of course paid. I am really interested into adding a Per User Role scenario for the exact functionalities your plugin has. Minimum – Maximum quantities and Step setting per product is perfect, but i need them to change per user role. There are some plugins in the market that do this as you have noticed, but i am really interested into working with you as i see your support is excellent. Note: I know my way around code, so if it too complicated to build the functionality for all user roles, and your advice is to manually assign meta boxes for the proper fields in product edit page, for each user role with snippets, we can do that, also paid if you want of course. Really looking forward for your answer. Cheers!

    1. Hi Nick,

      Sorry for a late reply. Please give me a couple of days to check if I could add it in the next plugin version.

    2. Hi Nick,

      We’ve just released new plugin version 1.6.1, where I have added new filters, so you could modify quantities by user role. Please take a look at the example in the Developers section.

      I planning on adding “quantities by user role” options later to the plugin itself, not sure how soon though.

      Anyway 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 us a rating.

  4. Are you planning to add an option to autoupdate the price of the product based in the price per unit? May be in the price field or as additions information I.E.: Current price: 2,35 €.

    Thanks for this fantastic plugin.

    1. Hi Fernando,

      Sorry for a late reply. Do you mean that you need the price to update in real time when customer changes quantity in the input box?

    2. Yes. May be the price itself or and additional text behind or after the quantity.

    3. Hi Fernando,

      We’ve just released new plugin version 1.6.1. After the update you will find new “Price by quantity” options (in “WooCommerce > Settings > Product Quantity > General”). I will be adding more options later (like choosing if you want to replace the price or add it as new text before or after the price), but basically it’s already working. Please check it out and let me know what you think. And if you like the plugin, please consider leaving us a rating.

  5. Hi Tom,
    I’m using this plugin and it’s perfect, but now I have a problem. For example, if I set the minimum quantity as 3, then I add a product, when I activate the option Inventory/Sold individually, so it will conflict with the minimum quantity. How to solve this problem? Thank you.

    1. Hi Rex,

      I have just tested it on my server and you are correct – when product is set to be “sold individually” and if the minimum quantity for all products is set for example to 3, then the plugin will display “wrong quantity” message. Will be fixing that in next plugin version, thanks for reporting. Meanwhile, you could use “Per product” minimum quantity instead of “All products”, however, I do understand that this solution can be unacceptable, especially if you have a lot of products in your shop…

    2. Hello Tom,
      Very thanks for your reply quickly. As you said, I have many products. I’m looking forward to the next update version.
      Anyway, thanks for your doing everything.
      Regards
      Rex

    3. Hi Rex,

      Hopefully I’ve managed to fix it in v1.6.1. Please check it out and let me know if something is still not working as expected.

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

  6. Hi,
    i have this plugin combined with a plugin for creating product bundles. Whenever i set a minimum quantity for a single products, this quantity is also applied on the products included in a bundle, which shouldn’t be the case. Is there a solution to this, so the minium quantity only applies to the products being bought seperately?

  7. i just install the plugin . and i cannot find where i can force display of minimum quantity in the archive and on the single product page.

    its still show “1” as default even id the minimum is 0.5.

    1. Hi,

      Sorry for a late reply. I’ve just checked and you are correct – for some reason it’s not forcing to a minimum quantity below 1. I’ve just tried setting minimum quantity to 1.5 and it’s working properly, but when I set it to 0.5 it’s not… Will be checking that asap.

    2. Hi again,

      After some testing I’ve figured out that setting “Force initial quantity on single product page” option to “Force to min quantity” in plugin’s “General Options” (in “WooCommerce > Settings > Product Quantity”) seems to be solving the issue. Please let me know if there are still any problems.

    3. Hi Tom,

      yes its look like its working but only on product single page, not on shop page.

      hope you can find easy fix for this issue:)

    4. Hi,

      Sorry for a late reply. Already fixed that in our development version, so it will be fixed in the next plugin release.

    5. Hi,

      As promised, we’ve just released new plugin version 1.6.0. After the update, you will find new “Force initial quantity on archives” option in plugin’s settings. Please let me know if it’s not working as expected.

      P.S. If you like the plugin, please consider leaving us a rating.

    6. hi ,

      i installed the last version on my site and still no change, its only working on product page.

      you can see here : (all set to 0.5 as minimum)

      http://super-click.co.il/product-category/%d7%a4%d7%99%d7%a8%d7%95%d7%aa/?v=88588bacf0da

    7. Hi,

      That’s strange… I have just rechecked it on my server and it seems to be working fine (with 0.5 set as minimum quantity for all products). Are you sure you are setting the new “Force initial quantity on archives” option to “Force to min quantity” (and not the old one “Force initial quantity on single product page” instead)?

      I’ve also tried opening the link to your site but got “The connection has timed out” error.

      Also if you wish you can create/share an admin account to your site, so I could log in and check what’s going on. My private email is [email protected].

    8. Hi Tom

      im sending you a login info to the domain.

      but before that, did you check on your end if ist work when you set products individually? and not global.

      perhaps this is the problem?

    9. Hi,

      I’ve just tested and unfortunately it’s still the same – even if I set minimum quantity on per product basis (i.e. individually) – “Force initial quantity on archives > Force to min quantity” option seems to be working fine on my server.

      P.S. Not sure if you have already sent me the login details, but I haven’t received it.

  8. Does this plugin allow you to set the quantity label on a per product basis?

    I need Quantity to say “Number of Children” but only on 3 or 4 products.

  9. Extending Karolinas idea of a per-category-basis I’d also suggest to have both “per item” and “per item and per product” run parallel where “per item” sets the standard quantity multiplier and “per item and per product” the product specific exceptions.

    Instead of editing each single product on changes in my quantity policy, I could then adapt most of the products’ quantities on a “per item” basis in one step and only care about exceptions on a per product quantity editing step. “Per item and per product” might be triggered when the meta box is not left empty or not zero (or both).

    1. Hi,

      I’m not sure if I understood it correctly, but I believe that plugin is already working as you’ve described. That is – if you set “Per item quantity – All products” option, then “Per item quantity – Per product” option works exactly as you’ve described, i.e. if it’s empty then “Per item quantity – All products” option value is used as a fallback.

  10. Hello! I think about buy PRO version.
    Can you tell me whether in the extended version I can set the minimum order quantity for a specific category, but not for individual products? It’s very important for me.

    1. Hi Karolina,

      Unfortunately this is not possible at the moment, however, this seems like a useful feature – will be adding it in next update.

  11. I installed the plug in an I noticed that the minimum quantity doesn’t refresh when you change the variation product from a higher quantity to a variation with a lower quantity. You can try in the product I am testing the plug in.

    1. Hi Renzo,

      Could you please try enabling “Force JS check” checkboxes in plugin settings (“Advanced Options” subsection at the bottom of settings page).

    2. I have them checked and is not refreshing.

    3. Hi, did you find out what could be the problem ?

    4. Hi Renzo,

      Sorry for not replying earlier. Yes, I can see the problem – already fixing this and I’m almost finished. Will get back to you as soon as possible.

    5. Perfect, Thank you

    6. Hi Renzo,

      We’ve just released new plugin version 1.5.0. After you update, please go to plugin settings (in “WooCommerce > Settings > Product Quantity”) and there in “General Options” section you will find new “On variation change (variable products)” option. Please set that to “Reset to min quantity”. Please let me know if it’s not working as expected.

  12. I will install it an try it. One more question. We are in the fresh cut flower business and we sale to wholesalers and retailers by the box. There are 4 kind of boxes with different capacities but the price is by the stem. so we can sell 1 HBX that fits 250 stems or 2 HBX with 500 stems or a QBX with 125 stems. Is there a plugin or this plug in handle 2 types of quantities ? So in the cart appears Like this sample:

    Qty Box Type Description Qty Price Total Amount
    1 HBX Color Rose 50 cms 500 $0.25 $125

  13. Can I use this plugin in variable products ?

    1. Hi Renzo,

      Yes, plugin is compatible with variable products. I.e. you can set all options (minimum quantity, maximum quantity, quantity step) for each variation separately.

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

    2. Is only available in the full version. I am not going to be able to try it.

    3. Unfortunately yes – as all “per product” options are available in Pro only, you won’t be able to test it in free version. However – as there is “30 days no questions asked” refund policy on WPFactory, we will issue a refund if something is not working as expected (or alternatively I could try to fix it if you’d wish).

    4. Is not possible to get a 30 day trial version ?

  14. Hello,
    Unfortunatelly this plugin is not compatible with the Flatsome theme. When I set decimal quantities 0,1 and I try it out, it will produce 1,100001 –> 1,200002 –> 1,300003 etc..

    1. Hi,

      Will be checking that asap. One question though – do you have any of Force JS check options enabled in plugin’s “Advanced Options” settings section (i.e. at the bottom of the page in “WooCommerce > Settings > Product Quantity”)? If you have – please try temporary disabling them to see if issue is still there.

    2. Hi,
      No, I dont.

    3. Hi,

      Sorry for a late reply. I’ve just checked and you are correct – Flatsome theme has issues with decimal quantities. The problem is in their custom plus and minus quantity buttons. They added custom JS code to handle it. For now the only “solution” I was able to come up with is to hide Flatsome’s plus and minus quantity buttons by adding custom CSS:

      input[type="button"].button.minus,
      input[type="button"].button.plus {
          display: none !important;
      }

      Ideally if we could bring back standard HTML number input spinners it would be working fine, however I didn’t manage to do it – will be trying further – unfortunately I’m not a big expert in CSS.

    4. Hi, we also use Flatsome. At which moment this issue pops up? I havn’t noticed it yet. Even when I use plus and minus to alter quantity everything works fine for me.

      Thank you!

  15. Hello…this plugin is working great for what I need it to do on my website…the cart totals are correct and are allowing customers to buy in steps of .5 units….however when you click the Proceed To PayPal button after confirming your cart total is correct…the information being fed to PayPal does NOT include the cost for those incremental units. So while the shopping cart shows 1.5 units in cart and the math is correct on the cart for what they owe…..when they hit the Proceed to PayPal button the information funneling to PayPal is as though there was only 1 unit in the cart. Is there a way to correct this? Thanks so much!

    1. Hi Laura,

      I’ve just re-checked it on my test server, but unfortunately couldn’t reproduce the issue. After adding 1.5 to the cart, the quantity in PayPal also shows 1.5, so it seems to be working fine here. I even tried to complete all the order to the end and it still shows 1.5 in my PayPal payment receipt. I’m using standard PayPal gateway (in sandbox mode) that comes with WooCommerce. Maybe you could send me the screenshot of the issue? Also – if possible maybe I could login to your server’s admin to check what’s going on? My private email is [email protected]

  16. Can this plug allow you to customize the quantities of a product that a customer can add to their cart? For example, I want a customer to be able to add 1, 2, or 4 of an item, but not 3.

    1. Hi Adam,

      Unfortunately I don’t think it’s possible at the moment. You could set minimum quantity to 2, step to 2 and maximum quantity to 4, but that would make quantity of 1 invalid. I could try to add this to the plugin, but I’m not sure how would admin set allowed quantities… I mean would listing all valid quantities as comma separated text (I mean by admin) would be good enough, e.g.: 1,2,4? And do you need this on per product basis (i.e. different for each product) or these quantities would be applied to all your shop’s products?

    2. Hi,

      We’ve just released new plugin version 1.5.0. After you update, you will find new “Exact Quantity” options section (in “WooCommerce > Settings > Product Quantity”). This should do exactly what you’ve described, i.e. set allowed or disallowed quantities as a comma-separated list, e.g. 3,7,11.

      Please let me know if something is not working as expected.

  17. I can’t configure a quantity like 0.96 on the steps, why?

    Kind regards.

    1. If anyone else has similar question – “Decimal quantities” option was added in plugin version 1.3.0.

Leave a Reply

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

Changelog

1.6.3 - 15/05/2019

  • Dev - Fallback method added for checking if WooCommerce plugin is active (fixes the issue in case if WooCommerce is installed not in the default woocommerce directory).

1.6.2 - 14/05/2019

  • Dev - "Rounding Options" options added.
  • Dev - Quantity Dropdown - "Max value fallback" option added (and dropdown can now also be enabled for variable products).
  • Dev - Advanced Options - Force JS check (periodically) - "Period (ms)" option added.
  • Dev - Price by Quantity - change event added (e.g. fixes the issue with plus/minus quantity buttons in "OceanWP" theme).
  • Dev - Code refactoring (alg-wc-pq-force-step-check.js and alg-wc-pq-force-min-max-check.js files added).
  • Tested up to: 5.2.

1.6.1 - 04/05/2019

  • Fix - Returning default min/max quantity for products with "Sold individually" option enabled.
  • Dev - "Price by Quantity" options added.
  • Dev - Admin Options - "Admin columns" options added.
  • Dev - alg_wc_pq_get_product_qty_step, alg_wc_pq_get_product_qty_min, alg_wc_pq_get_product_qty_max filters added.
  • WC tested up to: 3.6.

1.6.0 - 12/04/2019

  • Fix - Variable products - Reset step on variation change fixed.
  • Dev - "Quantity Info" options added.
  • Dev - "Quantity Dropdown" options added.
  • Dev - General Options - "Force initial quantity on archives" option added.
  • Dev - Code refactoring.
  • Dev - "Exact Quantity" renamed to "Exact (i.e. Fixed) Quantity".
  • Dev - Settings split into sections ("General", "Minimum Quantity", "Maximum Quantity", "Quantity Step", "Fixed Quantity").

1.5.0 - 31/01/2019

  • Fix - Stop customer from reaching the checkout page - "WC_Cart::get_cart_url is deprecated..." message fixed.
  • Dev - "Exact Quantity" section added.
  • Dev - General Options - "On variation change (variable products)" option added.
  • Dev - Code refactoring (alg-wc-pq-variable.js etc.).

1.4.1 - 17/01/2019

  • Fix - Step check - Min quantity default value changed to 0 (was 1).
  • Fix - Admin settings - Per product meta boxes - Step option fixed; checking if max/min sections are enabled.
  • Fix - Force minimum quantity - Description fixed.

1.4.0 - 14/01/2019

  • Dev - "Force JS check" options enabled for decimal quantities.
  • Dev - "Add to cart validation" option added.
  • Dev - "Quantity step message" option added.
  • Dev - "Force cart items minimum quantity" option added.
  • Dev - Force JS check - Quantity step - Now value is changed to nearest correct value (instead of always higher correct value).
  • Dev - Code refactoring.
  • Dev - Admin settings restyled and descriptions updated.

1.3.0 - 28/12/2018

  • Dev - "Decimal quantities" option added.
  • Dev - "Force initial quantity on single product page" option added.
  • Dev - "Quantity input style" option added.
  • Dev - Minor admin settings restyling.
  • Dev - Code refactoring.

1.2.1 - 23/10/2018

  • Dev - Min/max "Per item quantity" (for all products) moved to free version.
  • Dev - Admin settings descriptions updated.

1.2.0 - 18/10/2018

  • Fix - Cart min/max quantities fixed.
  • Dev - Advanced Options - "Force JS check" options added.
  • Dev - Raw input is now allowed in all "Message" admin options.
  • Dev - Code refactoring.
  • Dev - Minor admin settings restyling.
  • Dev - Plugin URI updated.

1.1.0 - 09/11/2017

  • Fix - Core - Checking if max/min section is enabled, when calculating product's max/min quantity.
  • Fix - Admin settings - Per product meta boxes - Checking if max/min section is enabled (not only "Per item quantity on per product basis" checkbox).
  • Fix - Core - Maximum order quantity - Upper limit bug fixed (when get_max_purchase_quantity() equals -1).
  • Dev - Core - Minimum order quantity - Upper limit (get_max_purchase_quantity()) added.
  • Dev - "Quantity Step" section added.

1.0.0 - 08/11/2017

  • Initial Release.

Frequently Asked Questions

Q. I can't find the plugin form on product edit page. Where do I put my minimum quantity for a product?

A. First you need to enable "Per item quantity - Per product" checkbox in plugin's settings (in "WooCommerce > Settings > Product Quantity > Minimum Quantity"). After that, you should see this meta box on each product's edit page.


Q. I want to limit the quantity someone can select at a product by product basis. For one product they can purchase from 1 to 20, but no more than 20. Will your plugin do that?

A. Yes, the plugin can do that. In the free version, you will be able to set the maximum quantity to 20 for all products at once. To set maximum quantity for some products only, you will need the Pro version:

In the free version you would need to:
1. Enable section for "Maximum Quantity Options" in "WooCommerce > Settings > Product Quantity".
2. Set Per item quantity - All products option to "20".

In Pro version you would need to:
1. Enable section for "Maximum Quantity Options" in "WooCommerce > Settings > Product Quantity".
2. Enable Per item quantity - Per product option there.
3. Go to some product's admin edit page and set "Maximum quantity" to "20" in "Product Quantity" meta box.


Q. Do you have a demo website for the plugin?

A. Unfortunately we don't have a demo site yet, however, generally, you can see how it works by installing the free version - https://wordpress.org/plugins/product-quantity-for-woocommerce/. Also - as there is 30 days "no questions asked" refund policy on WPFactory, we'll be happy to issue a refund if something in plugin isn't working as expected, or, if you wish, we could try to fix it.

Free vs Pro

This plugin is a premium version of free "Product Quantity for WooCommerce" plugin.

Free VersionPro Version
Minimum cart total quantityyesyes
Minimum per item quantity - All productsyesyes
Minimum per item quantity - Per productnoyes
Maximum cart total quantityyesyes
Maximum per item quantity - All productsyesyes
Maximum per item quantity - Per productnoyes
Quantity step - All productsyesyes
Quantity step - Per productnoyes
Decimal quantitiesyesyes
Force initial quantity on single product pageyesyes
Cart noticesyesyes
Stop customer from accessing checkout on wrong quantitiesyesyes
Customizable customer messagesyesyes
Quantity input styleyesyes

Developers

Plugin has three filters, so you can modify plugin's min quantity, max quantity and quantity step with your own code: alg_wc_pq_get_product_qty_min, alg_wc_pq_get_product_qty_max and alg_wc_pq_get_product_qty_step. All filters has two parameters: filtered value and product ID.

For example, you may want to modify quantities by user role - in this case you will need to add something like this to your (child) theme's functions.php file:

add_filter( 'alg_wc_pq_get_product_qty_min', 'my_product_qty_min_by_user_role', 10, 2 );
function my_product_qty_min_by_user_role( $qty, $product_id ) {
	$current_user = wp_get_current_user();
	return ( in_array( 'administrator', $current_user->roles ) ? 5 : $qty );
}

If you need to get some product's min/max/step quantities with PHP:

$product_id = $product->get_id();
$default    = 1;
$min_qty    = alg_wc_pq()->core->get_product_qty_min_max( $product_id, $default, 'min' );
$max_qty    = alg_wc_pq()->core->get_product_qty_min_max( $product_id, $default, 'max' );
$qty_step   = alg_wc_pq()->core->get_product_qty_step( $product_id, $default );

Plugin's product quantity data is saved in product meta with these keys:

_alg_wc_pq_min
_alg_wc_pq_max
_alg_wc_pq_step
_alg_wc_pq_exact_qty_allowed
_alg_wc_pq_exact_qty_disallowed

Prices & Licenses

Single siteUnlimited sites
1 year[buy] $19.99 / year[buy] $29.99 / year
Lifetime[buy] $39.99[buy] $59.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.