diff --git a/woocommerce-functions.php b/woocommerce-functions.php index ee95186c0bd..7a19a2e1bc1 100644 --- a/woocommerce-functions.php +++ b/woocommerce-functions.php @@ -62,10 +62,7 @@ function woocommerce_template_redirect() { // Force SSL elseif ( get_option('woocommerce_force_ssl_checkout') == 'yes' && ! is_ssl() ) { - if ( is_checkout() ) { - wp_safe_redirect( str_replace('http:', 'https:', get_permalink( woocommerce_get_page_id( 'checkout' ) ) ), 301 ); - exit; - } elseif ( is_account_page() || apply_filters( 'woocommerce_force_ssl_checkout', false ) ) { + if ( is_checkout() || is_account_page() || apply_filters( 'woocommerce_force_ssl_checkout', false ) ) { if ( 0 === strpos( $_SERVER['REQUEST_URI'], 'http' ) ) { wp_safe_redirect( preg_replace( '|^http://|', 'https://', $_SERVER['REQUEST_URI'] ) ); exit;