Require Minimum Cart Total for WooCommerce

Require minimum WooCommerce cart total for checkout.

/**
 * Require minimium WooCommerce cart total for checkout
 */
function wc_minimum_checkout() {

// Minimum Amount for Woo Cart
$minimum_amount = 49;

if( WC()->cart->subtotal < $minimum_amount ) {

wc_print_notice( sprintf( __( 'Please meet the required minimum of <strong>%s</strong> in order to checkout.', 'woocommerce' ), wc_price( $minimum_amount ) ), 'error' );

remove_action( 'woocommerce_proceed_to_checkout', 'woocommerce_button_proceed_to_checkout', 20 );
	}
}
add_action( 'woocommerce_before_cart', 'wc_minimum_checkout()' );