Tips and Tricks HQ Support Portal › Forums › WP eStore Forum › Cart Shows Contents After Logout
- This topic has 4 replies, 2 voices, and was last updated 11 years, 11 months ago by Bob Rockefeller.
-
AuthorPosts
-
December 1, 2012 at 9:08 pm #8048Bob RockefellerMember
If a client adds things to their cart and then logs out, the items in their cart still show. if the user is logged out, I’d like to cart to be empty. if he had saved some things there, they can re-appear after he logs back in.
How do I do that?
Bob
December 3, 2012 at 1:00 am #51935adminKeymasterThe shopping cart has nothing to do with member login or logout. The cart works on its own. If for whatever reason you want to hide the cart from normal users and only show to the logged in users then simply put the cart inside eMember’s protected content shortcode.
December 3, 2012 at 5:29 pm #51936Bob RockefellerMemberIt’s not the display of the shopping cart that’s the problem. It’s shown when and where I want it. The problem is that items are in the cart when no user is logged in. I’d like the cart to be empty, if the users is not logged in.
Bob
December 4, 2012 at 4:25 am #51937adminKeymasterYou probably didn’t understood my previous reply. The cart doesn’t care about a user’s member login status. It completely operates on its own based on per visitor on your site (this is why it doesn’t matter if a user is logged in or not). If a visitor adds item(s) to the cart, it will be there until that visitor clears them.
Now, if you want to make it so only logged in users see the cart you can do that too but you will need to tie it with eMember and set it up that way. I will try to give you examples:
Example 1: Lets say, you don’t want your visitors to be able to checkout unless they are logged into the site. Simply do the following and you will get this taken care of:
1) Go to eStore settings -> Addon Settings -> eMember plugin specific settings
2) Check the “Only Logged In Members Can Checkout” field and save the settings.
Now, your visitors can add items to the cart as usuall but they can’t complete the checkout unless are logged into the site as a member/user.
Example 2: Lets say, you want to empty the cart whenever an eMember user logs out from the site. You can do that by using eMember’s after login redirection feature. Simply add a URL like the following in eMember’s after login redirection URL field:
http://www.your-domain.com/?reset_eStore_cart=1
Let me now if that makes sense
December 4, 2012 at 5:37 pm #51938Bob RockefellerMemberExample 2 was just what I was looking for. Thanks!
Bob
-
AuthorPosts
- You must be logged in to reply to this topic.