The code above didn’t work for me. I played around with a bit and got it to work. I don’t know php so it might not be the best way of coding it.
add_action('woocommerce_before_checkout_process','minimum_order_func');
function minimum_order_func(){
global $woocommerce;
$minorder = 50;
if( $woocommerce->cart->subtotal<$minorder ){
$woocommerce->add_error( sprintf(__('Sorry, you have not met the minimum order amount of $' . $minorder . '. <a href="%s">Return to homepage →</a>', 'woocommerce'), home_url()) );
}
}