• Skip to primary navigation
  • Skip to main content
OsomCode

OsomCode

Awesome code tutorials for WordPress and Genesis

  • Subscribe
  • My account
    • Edit profile
    • Favorites
    • Update credit card
  • Login

Setting a minimum price to place an order in WooCommerce

Learn in this tutorial how to set a minimum purchase price for a WooCommerce order to be placed, with a simple code snippet.

Depending on the type of products you sell, it may be in your or your customer’s interest to limit the sale if a minimum price is not reached.

Interested? Here’s how to do it.

Snippet to set a minimum price to complete the order in WooCommerce

Add the following code at the end of functions.php or in your functionality plugin:

To see this and another 847 code snippets of this website, login or subscribe here.

It’s as simple as that. In this case, the minimum price is 100, but you can change it to whatever you want, as well as the message that is displayed if the minimum price is not reached.

You can also combine this snippet with WooCommerce conditional tags so that it only affects certain products, categories…

Conclusion

As you can see, with a few lines of code you can set a minimum purchase price in your ecommerce created with WooCommerce.

Any questions? I read you in the comments.

And if you want to give me any suggestion for future tutorials, leave it in the contact form. Advantages of being a subscriber. 😉

PHP Products WooCommerce WordPress

To leave read and make questions about this code, you can login or register.

  • About OsomCode
  • FAQ
  • Contact

Legal Notice · Privacy Policy · Cookie Policy · Terms and conditions
Copyright © 2023

Lost your password?