wocommerce is clearing shopping cart when i am loging out
-
I have a weird problem in my website. I am using WordPress, and for e commerce i used woocommerce plugin.
I have problem with accounts and shopping cart. When costumers are login with their account and add items to cart, these items are being deleted after they logout, and they want these items to have in cart until they make checkout. How can i achieve this ? My code for login and logout is like this:
<div id='sales-nav'><?php if ( is_user_logged_in() ) { ?> <a href="<?php echo get_permalink( get_option('woocommerce_myaccount_page_id') ); ?>" title="<?php _e('My Account','woothemes'); ?>"><?php _e('My Account','woothemes'); ?></a><a href="<?php echo wp_logout_url( home_url() ) ?>" title="Logout">Logout</a> <?php } else { ?> <a href="<?php echo get_permalink( get_option('woocommerce_myaccount_page_id') ); ?>" title="<?php _e('Login / Register','woothemes'); ?>"><?php _e('Login / Register','woothemes'); ?></a> <?php } ?><div id='cart_container'><a href='/cart'>Cart - <?php global $woocommerce; echo "<div id='cart_total'>" . $woocommerce->cart->get_cart_total() . "</div></a></div>";?> <?php if (sizeof($woocommerce->cart->cart_contents)>0) :?> <a href="<?php echo $woocommerce->cart->get_checkout_url()?>" title="<?php _e('Checkout','woothemes') ?>"><?php _e('Checkout','woothemes') ?></a> <?php endif; ?></div>
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘wocommerce is clearing shopping cart when i am loging out’ is closed to new replies.