How to set minimum order amount in Woocommerce ?

In this tutorial we’ll learn how to set minimum order amount in woocommerce. By default in woocommerce you can order upto any amount but sometimes you need to limit the customer’s purchases to a limit. We can achieve this quite easily.

Place the following lines of code at the end of your functions.php file.

add_action( 'woocommerce_checkout_process', 'wc_minimum_order_amount' );
function wc_minimum_order_amount() {
                global $woocommerce;
                $minimum = 50;
                if ( $woocommerce->cart->get_cart_total() < $minimum ) {
           $woocommerce->add_error( sprintf( 'You must have an order with a minimum of %s to place your order.' , $minimum ) );

Replace the value of variable 50 with the amount you want to set as your minimum limit.

You can access functions.php here:

woocommerceSave the file after placing code.

Now when the user try to checkout having cart amount less than minimum limit they’ll receive this error.


Editorial Staff

ThemeLocation Provides Wordpress & Woocommerce development & Customization services. Have a Project? Contact To discuss

2 thoughts on “How to set minimum order amount in Woocommerce ?

Leave a Reply

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