Ensure get checkout URL forces SSL. Closes #3029.
This commit is contained in:
parent
5fb393b960
commit
72de000465
|
@ -663,12 +663,14 @@ class WC_Cart {
|
||||||
*/
|
*/
|
||||||
public function get_checkout_url() {
|
public function get_checkout_url() {
|
||||||
$checkout_page_id = woocommerce_get_page_id('checkout');
|
$checkout_page_id = woocommerce_get_page_id('checkout');
|
||||||
|
$checkout_url = '';
|
||||||
if ( $checkout_page_id ) {
|
if ( $checkout_page_id ) {
|
||||||
if ( is_ssl() )
|
if ( is_ssl() || get_option('woocommerce_force_ssl_checkout') == 'yes' )
|
||||||
return str_replace( 'http:', 'https:', get_permalink($checkout_page_id) );
|
$checkout_url = str_replace( 'http:', 'https:', get_permalink( $checkout_page_id ) );
|
||||||
else
|
else
|
||||||
return apply_filters( 'woocommerce_get_checkout_url', get_permalink($checkout_page_id) );
|
$checkout_url = get_permalink( $checkout_page_id );
|
||||||
}
|
}
|
||||||
|
return apply_filters( 'woocommerce_get_checkout_url', $checkout_url );
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in New Issue