Sawir Min Max Quantities for WooCommerce

Description

Sawir Min Max Quantities for WooCommerce lets store owners control how many items customers can buy. Set minimum, maximum, and “group of” multiple quantities per product, per variation, per product category, and for the total number of items in an order. Rules are enforced on product page quantity inputs, when adding to cart, and again on the cart and checkout pages.

Developed by Ricardo Sawir for Sawir Studio LLC.

  • Website: https://sawirstudio.com
  • X: https://x.com/RicardoSawir
  • GitHub: https://github.com/sawirricardo
  • Email: ricardo@sawirstudio.com

More plugins by Sawir Studio

Features

  • Adds minimum, maximum, and group-of quantity fields to the product Inventory tab.
  • Adds optional minimum, maximum, and group-of overrides to each variation.
  • Adds minimum, maximum, and group-of quantity fields to product categories.
  • Lets category rules apply to the combined cart quantity for that category instead of as a per-product fallback.
  • Adds order-level minimum and maximum item limits under WooCommerce > Settings > Products > General.
  • Applies a clear precedence: a variation rule wins; otherwise a product rule wins; otherwise the most restrictive unchecked category fallback applies.
  • Variations inherit empty fields from their parent product or category fallback.
  • Enforces rules on product page and variation quantity inputs, including step values for group-of multiples.
  • Blocks add-to-cart actions that would exceed a product maximum.
  • Validates all rules on the cart and checkout pages with clear error notices, including multiples such as “must be purchased in multiples of N.”
  • Leaves quantity inputs on the cart page free to reach zero so items can still be removed.
  • Requires no configuration to install; rules are optional everywhere.
  • Cleans up all plugin options and metadata when the plugin is uninstalled.

Installation

  1. Upload the plugin files to /wp-content/plugins/sawir-min-max-quantities-for-woocommerce.
  2. Activate the plugin through the WordPress Plugins screen.
  3. Edit a product and set minimum, maximum, or group-of quantities in the Inventory tab, or edit a product category and set its quantity fields.
  4. Optionally set order-level item limits under WooCommerce > Settings > Products > General.
  5. Visit a product page and try quantities outside the rules to see them enforced.

FAQ

Does this require WooCommerce?

Yes. This plugin is built for WooCommerce products, cart, and checkout hooks.

What happens when a product has both its own rule and a category rule?

The product rule wins. Category rules only apply to products that have no rule of their own.

Can variations have their own rules?

Yes. Each variation can set its own minimum, maximum, and group-of values. Empty variation fields inherit from the parent product or category fallback.

What does “group of” mean?

“Group of” requires the quantity to be purchased in multiples of that number. For example, a group of 6 allows 6, 12, 18, and so on.

What if a product belongs to multiple categories with rules?

The most restrictive combination applies: the highest minimum, the lowest maximum, and the shared multiple needed to satisfy group-of rules across its unchecked fallback categories.

What does “Apply rules to category total” do?

When enabled on a category, that category’s rules apply to the combined quantity of all matching cart items. The category no longer acts as a per-product fallback while that option is enabled.

Does a parent product maximum limit all variations combined?

Yes, as long as the variations have no rules of their own: their quantities are summed and checked against the parent rule. A variation with its own rule is limited individually instead of counting toward the parent total.

Why can customers add less than the minimum to the cart?

Minimums and group-of multiples are enforced on the cart and checkout pages so customers can build up quantity across multiple adds. Checkout stays blocked until the rules are met. Maximums are blocked immediately at add-to-cart.

How do I remove a rule?

Leave the field empty (or set it to zero) and save. Empty fields mean no rule.

Does uninstalling remove the plugin data?

Yes. Deleting the plugin removes its options, product metadata, and category metadata.

Reviews

There are no reviews for this plugin.

Contributors & Developers

“Sawir Min Max Quantities for WooCommerce” is open source software. The following people have contributed to this plugin.

Contributors

Changelog

1.0.1

  • Add links to other Sawir Studio plugins.

1.0.0

  • Initial release.
  • Minimum, maximum, and group-of quantity rules per product, per variation, per product category, and per order.
  • Optional category-total validation for combined quantities in a category.
  • Enforcement on quantity inputs, add-to-cart, and cart/checkout validation.