parent
fc6097c7b0
commit
930cc3fbd3
|
@ -28,7 +28,7 @@ function wc_template_redirect() {
|
|||
|
||||
// When on the checkout with an empty cart, redirect to cart page
|
||||
elseif ( is_page( wc_get_page_id( 'checkout' ) ) && WC()->cart->is_empty() && empty( $wp->query_vars['order-pay'] ) && ! isset( $wp->query_vars['order-received'] ) ) {
|
||||
wc_add_notice( __( 'Checkout is not available whilst your cart is empty.', 'woocommerce' ) );
|
||||
wc_add_notice( __( 'Checkout is not available whilst your cart is empty.', 'woocommerce' ), 'notice' );
|
||||
wp_redirect( wc_get_page_permalink( 'cart' ) );
|
||||
exit;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue