This website uses cookies

Our website, platform and/or any sub domains use cookies to understand how you use our services, and to improve both your experience and our marketing relevance.

CloudwaysCDN — a powerful solution that offers superior performance and satisfied global audience for your business. Read More

How to Add Minimum Shipping Requirements Rule on Products in WooCommerce

Updated on  25th July

4 Min Read
Reading Time: 4 minutes

Chances are that you need to set some sort of least requirements on your WooCommerce store before your customers checkout. There are currently multiple methods for setting least requirement in WooCommerce; the outcomes may even be identical. But I consider the techniques below to be the appropriate methods for doing it.

Shipping Requirements Rule on Products in WooCommerce

Setting A Minimum Number Of Products Required Per Order

Another significant scenario is setting a minimum number of products that must be requested at once before permitting the client to completely pay for his request and dispatching the goods. Change “10” to whatever works best for your requirements. You need to ensure that you just run this code on the cart and checkout pages. For this we utilize is_cart() and is_checkout(), which return ‘true’ at whatever point we are on those two particular pages.

Put the following code in functions.php which located in theme folder.

minimum product requirement

Setting a Minimum Quantity per Product

Setting a minimum amount for every product is a common necessity for WooCommerce stores, especially if you are offering wholesale. Setting a minimum amount will restrict your customer(s) from buying a particular product  in lesser amounts. For us to check for the minimum amounts, we have to loop through each and every product in the cart and check it against our minimum  quantity per product necessities set up.

To set these restrictions, you have to make an array which holds your rules/limitations inside another array. Be careful when altering this array, and ensure that all code is entered precisely in order to prevent errors and unexpected results. The format you need to use is as follows:

Here is how it will look on your website:

minimum quantity requirement woocommerce

Conclusion

WooCommerce permits you to utilize actions and filters to change the ordinary checkout process. All stores are distinctive and having the capacity to set these restrictions — when required — is crucial. For us developers, who need to accomplish tasks like these, knowing how to alter shipping rules is key.

Share your opinion in the comment section. COMMENT NOW

Owais Alam

is the WordPress Community Manager at Cloudways - A Managed WooCommerce Hosting Platform and a seasoned PHP developer. He loves to develop all sorts of websites on WordPress and is in love with WooCommerce in particular. You can email him at owais.alam@cloudways.com

Start Growing with Cloudways Today.

Our Clients Love us because we never compromise on these

Get Our Newsletter
Be the first to get the latest updates and tutorials.

THERE’S MORE TO READ.