Want to know what WordPress Theme a site is using? Check Out Now!

How to Limit Product Quantity to 1 For All WooCommerce Products?

WooCommerce does allow you to limit quantity in a single product. But there’s no option to achieve the same for all products at once.

You can limit the quantity to 1 for all WooCommerc products by using the ‘woocommerce_is_sold_individually’ filter.

 * Limit Product Quantity to 1 for All WooCommerce Products
function maverick_limit_product_quantity($return, $product)
	return true;

add_filter('woocommerce_is_sold_individually', 'maverick_limit_product_quantity', 10, 2);

Leave a Reply

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