WooCommerce Set Minimum Product Quantity For All Products

WooCommerce minimum product quantities


There are no pre-requisites in order for you to be able to implement this solution.

How To Implement This Solution?

Simply copy the pre-coded solution to your active theme’s functions.php or preferably the Code Snippets Plugin.

About this Solution

This guide shows you how you can globally set a minimum product quantity across all products in your store. Minimum product quantities are a great way of increasing your Average Order Value (AOV) because the customer must add more than one of your products to their cart. This guide would be useful products where shipping just one isn’t practical in terms of your store making a profit. Perhaps you sell frozen goods and need to enforce a minimum quantity to ensure the package stays frozen during transit. This particular solution only forces a minimum quantity and does not affect the step quantity. For example, if you set a minimum quantity of 10, the customer is still able to buy 11 of your products but there must be a minimum of 10. We have published a guide on changing the step quantity too, go ahead and check it out if your business requires this functionality.

 * Snippet Name:	WooCommerce Set Minimum Product Quantity For All Products
 * Snippet Author:	ecommercehints.com

add_filter( 'woocommerce_quantity_input_args', 'ecommercehints_minimum_product_quantity_input_step', 10, 2 ); // Simple products

function ecommercehints_minimum_product_quantity_input_step( $args, $product ) {
	$minimum_quantity = 10;		// The minimum quantity you'd like to set
	if ( is_singular( 'product' ) ) {
		$args['input_value'] 	= $minimum_quantity;
	$args['min_value'] 	= $minimum_quantity;
	return $args;

add_filter( 'woocommerce_available_variation', 'ecommercehints_minimum_variation_quantity' ); // Product variations

function ecommercehints_minimum_variation_quantity( $args ) {
	$args['min_qty'] = $minimum_quantity;
	return $args;

Snippet Benefits

  • Increase your Average Order Value (AOV) by forcing a minimum product quantity before it can be added to the cart.
WooCommerce Conversion Rate Optimisation (CRO) eBook
100 WooCommerce Conversion Rate Optimisation Tips

Leave a Reply

If you are going to write code in the comments, please wrap it between code tags.

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

Other Recent Guides

Subscribe To Emails

Get exclusive WooCommerce tips that I only share with email subscribers

Join hundreds of other subscribers