The Min/Max Quantities extension for WooCommerce allows you to define minimum and maximum allowable product quantities per product, order or variation. It also lets you define a group quantity if your product must be bought in groups of x.
Installation ↑ Back to Top
To install the extension:
- Download the extension from your dashboard
- Upload the plugin folder to your /wp-content/plugins/ directory
- Activate ‘WooCommerce Min/Max Quantities’ from the Plugins menu within WordPress
Order-level Rules ↑ Back to Top
Go to WooCommerce > Settings. You will see the following settings:
All settings take numeric values and are optional.
- Minimum order quantity – Customer must purchase no less than this quantity of items to checkout.
- Maximum order quantity - Customer must purchase no more than this quantity of items to checkout.
- Minimum order value – Customer’s cart contents must cost more than this amount.
- Maximum order value – Customer’s cart contents must cost less than this amount.
Product-level Rules ↑ Back to Top
Edit a product within admin and look inside the product data panel. You will see the following:
Like the order settings, these are all optional.
- Minimum quantity – Customer must purchase more than this amount.
- Maximum quantity – Customer must purchase less or equal to this amount.
- Group of… – Users must purchase a multiple of this amount.
- Order rules: Do not count – Exclude orders from the counts of the above per-order rules.
- Order rules: Exclude – Exclude from the per-order rules entirely.
Variation-level Rules ↑ Back to Top
Variations inherit the main product settings (above), however you can define them per-variation too. To enable the settings to appear per-variation, check the Min/Max box:
Category-level Rules ↑ Back to Top
If you go to Products > Categories and edit a category, you’ll be able to set the “group of” option:
This lets you setup rules such as “Customers must buy products in X category in groups of X only”.
What the customer sees ↑ Back to Top
The extension modifies the frontend in the following ways:
- When adding items to the cart, if they have met the ‘maximum’ limits an error will be shown and the item not added to the cart.
- When using the quantity selectors on single product pages only, there will be a min, max, and step attribute added. So corrections are possible, min and max will not be used on the cart page.
- When viewing the cart, errors will be shown if any rules are not met.