How to set minimum and maximum purchasable quantity for a WooCommerce product without any plugin.

One of the best things about WooCommerce which makes it so widely adapted ecommerce platform is it’s customizability.

With this little peice of code we can limit the minumun purchasable quantity for all products in the site

PHP

If you want to add this restriction for only a certain product then you only need to make a slight modification:

PHP

Set maximum purchasable quantity

PHP

Leave a Reply

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

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Up Next:

Basic Rate-limiting in WooCommerce with native class

Basic Rate-limiting in WooCommerce with native class