[Plugin: WooCommerce – excelling eCommerce] Logout code snippet
-
Hi,
I’m trying to add a logout link when the user is logged into the site. I’m currently using this code on my functions.php page:
<ul class="quick-cart"> <li><span class="quick-cart-copy">Your Cart Has:</span><?php global $woocommerce; ?> <a class="cart-contents" href="<?php echo $woocommerce->cart->get_cart_url(); ?>" title="<?php _e('View your shopping cart', 'woothemes'); ?>"><?php echo sprintf(_n('%d item', '%d items', $woocommerce->cart->cart_contents_count, 'woothemes'), $woocommerce->cart->cart_contents_count);?> - <?php echo $woocommerce->cart->get_cart_total(); ?></a> </li> <li><?php if (sizeof($woocommerce->cart->cart_contents)>0) :?> <a href="<?php echo $woocommerce->cart->get_checkout_url()?>" title="<?php _e('Checkout','woothemes') ?>" class="checkout button"> <?php _e('Checkout','woothemes') ?></a> <?php endif; ?> </li> <li> <?php if ( is_user_logged_in() ) { ?> <a href="<?php echo get_permalink( get_option('woocommerce_myaccount_page_id') ); ?>" title="<?php _e('My Account','woothemes'); ?>" class="my-account button"> <?php _e('My Account','woothemes'); ?></a> <?php } else { ?> <a href="<?php echo get_permalink( get_option('woocommerce_myaccount_page_id') ); ?>" title="<?php _e('Login / Register','woothemes'); ?>" class="login button"><?php _e('Login / Register','woothemes'); ?></a> <?php } ?></li> </ul>But there doesn’t appear to be anything that allows the user to logout. Any help is much appreciated. Thanks!
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
The topic ‘[Plugin: WooCommerce – excelling eCommerce] Logout code snippet’ is closed to new replies.