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:
Save the file after placing code.
Now when the user try to checkout having cart amount less than minimum limit they’ll receive this error.
Hello friends,
We have created a plugin for solving this issue you can find it here
https://wordpress.org/plugins/woo-min-max-quantity-limit/
I was use your plugin, but i can’t set unlimited max quantity.