add_action( 'woocommerce_checkout_process', 'custom_minimum_order_amount' ); function custom_minimum_order_amount() { $minimum = 10; if ( WC()->cart->total < $minimum ) { if( is_cart() ) { wc_print_notice( sprintf( 'Your current order total is %s — you must have an order with a minimum of %s to proceed to checkout.', wc_price( WC()->cart->total ), wc_price( $minimum ) ), 'error' ); } else { wc_add_notice( sprintf( 'Your current order total is %s — you must have an order with a minimum of %s to proceed to checkout.', wc_price( WC()->cart->total ), wc_price( $minimum ) ), 'error' ); } } }