</div>
<div id="woo-quick-checkout" class="small-4 columns right">
<?php
- $logout_url = wp_logout_url( get_permalink( $myaccount_page_id ) );
-
+ $myaccount_page_id = get_option( 'woocommerce_myaccount_page_id' );
+ if ( $myaccount_page_id ) {
+ $myaccount_page_url = get_permalink( $myaccount_page_id );
+ }
if ( get_option( 'woocommerce_force_ssl_checkout' ) == 'yes' ) {
+ $myaccount_page_url = str_replace( 'http:', 'https:', $myaccount_page_id );
+ } else {
+ $myaccount_page_url = str_replace( 'https:', 'http:', $myaccount_page_id );
+ }
+
+
+ if ( $myaccount_page_id ) {
+
+ $logout_url = wp_logout_url( get_permalink( $myaccount_page_id ) );
+
+ if ( get_option( 'woocommerce_force_ssl_checkout' ) == 'yes' )
$logout_url = str_replace( 'http:', 'https:', $logout_url );
}
+
if (is_user_logged_in()) {
echo '<a href="'. $logout_url . '" class="button login_toggle">log out</a>';
}
elseif (!is_user_logged_in()) {
- echo '<a href="'. get_permalink( $myaccount_page_id ) . '" class="button login_toggle">log in</a>';
+ echo '<a href="'. $myaccount_page_url . '" class="button login_toggle">log in</a>';
}
?>
<a href="<?php echo $woocommerce->cart->get_checkout_url(); ?>" class="button">checkout</a>