WP Manifestindependent plugin directory
manifest / ecommerce / woocommerce-minimum-quantity

WooCommerce Minimum Quantity per Product

Set minimum quantity requirement for each product individually in WooCommerce. Customers must add at least the minimum quantity to cart.

by Mehran Khan · github.com/mehrankhan38/woocommerce-minimum-quantity · website

1stars
0forks

Install

No release zip yet. The repository archive installs, but the folder name will carry the branch suffix and updates will not flow:

wp plugin install https://github.com/mehrankhan38/woocommerce-minimum-quantity/archive/refs/heads/main.zip

A free WordPress plugin that allows you to set minimum quantity requirements for individual products in WooCommerce. Each product can have its own minimum quantity, and customers must add at least that quantity to their cart.

Description

This plugin gives you complete control over minimum order quantities for each product in your WooCommerce store. Set different minimum quantities for different products, including product variations. Perfect for bulk orders, wholesale pricing, or products that require minimum purchase quantities.

Features

  • Per-Product Minimum Quantity - Set minimum quantity for each product individually
  • Variation Support - Set minimum quantity for product variations
  • Cart Validation - Automatically validates quantities when adding to cart
  • User-Friendly Messages - Clear error messages when minimum quantity is not met
  • Product Page Notice - Displays minimum quantity requirement on product pages
  • Cart Enforcement - Prevents checkout if cart quantities are below minimum
  • Lightweight & Fast - Minimal code, maximum performance
  • Free & Open Source - Free to use and modify

Installation

Method 1: Manual Installation

  1. Download the plugin ZIP file from the Releases page
  2. Go to WordPress Admin → Plugins → Add New
  3. Click "Upload Plugin" and select the ZIP file
  4. Click "Install Now" and then "Activate"

Method 2: Git Clone

cd wp-content/plugins/
git clone https://github.com/yourusername/woocommerce-minimum-quantity.git

Then activate the plugin from WordPress Admin → Plugins

Requirements

  • WordPress 5.0 or higher
  • WooCommerce 3.0 or higher
  • PHP 7.2 or higher

Usage

Setting Minimum Quantity for Simple Products

  1. Go to ProductsAll Products in WordPress admin
  2. Edit the product you want to set minimum quantity for
  3. Scroll down to the Inventory section
  4. Find the Minimum Quantity field
  5. Enter the minimum quantity (e.g., 5, 10, 20)
  6. Click Update to save

Setting Minimum Quantity for Product Variations

  1. Edit a variable product
  2. Go to the Variations tab
  3. Expand a variation or select multiple variations
  4. Find the Minimum Quantity field
  5. Enter the minimum quantity for that variation
  6. Click Save changes

How It Works

  • When a customer tries to add a product to cart with quantity less than minimum, they'll see an error message
  • The error message clearly states the minimum quantity required
  • Customers cannot proceed to checkout if cart contains products below minimum quantity
  • Product pages display a notice showing the minimum quantity requirement
  • Cart quantities are automatically validated and updated if needed

Screenshots

Product Edit Page

The minimum quantity field appears in the Inventory section of the product edit page.

Variation Settings

Each variation can have its own minimum quantity setting.

Frontend Notice

Customers see a clear notice on product pages about minimum quantity requirements.

Cart Validation

Error messages appear when customers try to add products below minimum quantity.

Frequently Asked Questions

Can I set different minimum quantities for different products?

Yes! Each product can have its own minimum quantity. Simply set it in the product edit page.

Does it work with product variations?

Yes, the plugin fully supports product variations. Each variation can have its own minimum quantity.

What happens if a customer adds less than minimum quantity?

The customer will see an error message explaining the minimum quantity requirement, and the product won't be added to cart.

Can I leave minimum quantity empty?

Yes, if you leave the minimum quantity field empty, there will be no minimum requirement for that product.

Does it work with existing cart items?

Yes, the plugin validates all cart items and prevents checkout if any product is below its minimum quantity.

Changelog

1.0.0

  • Initial release
  • Per-product minimum quantity support
  • Variation support
  • Cart validation
  • Product page notices
  • Checkout prevention for invalid quantities

Support

For support, feature requests, or bug reports, please open an issue on GitHub.

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

License

This plugin is licensed under the GPL v2 or later.

Copyright (C) 2024 Mehran Khan

This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

Credits

Developed by Mehran Khan

Tags

woocommerce, minimum quantity, bulk orders, wholesale, cart validation, product variations, ecommerce