Set minimum order amount

Set minimum order amount WooCommerce support to any WordPress theme:

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 ) );
	}
}
See also  Change Input Field to Textarea on Checkout

Leave a Reply

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