Simple Membership Plugin › Forums › Simple Membership Plugin › Logout deletes the shopping cart
Tagged: logout woocommerce
- This topic has 6 replies, 3 voices, and was last updated 4 years, 3 months ago by
Rynhrd.
-
AuthorPosts
-
June 30, 2022 at 6:21 pm #24046
Rynhrd
ParticipantHi to all 🙂
I’m very happy to have found this great plugin and have already created several members areas. Works perfectly!
However, a problem has arisen:
I run an online shop with woocommerce. In the protected areas, I also include shop items that match the content – I tried with put the items inside and/or outside of the partial protection shortcodes.
If the member puts one of these items in the shopping cart and then logs out of the members area (using the linkhttps://www.your-domain.com/?swpm-logout=true), the shopping cart will be emptied.
Can this be prevented somehow so that the shopping cart is NOT deleted when you log out?BIG THNX for your help, Rynhrd
July 1, 2022 at 3:16 am #24053mbrsolution
ModeratorHi, are you wanting to protect the shopping cart post and only allow logged in shoppers to purchase the product?
Regards.
July 1, 2022 at 6:10 am #24055Rynhrd
ParticipantHi, thny for your answer 😉
No – the products are all public, anyone can see and order them. And it makes no difference where products are ordered – whether in the members area (a “copy” of the product) or on normal public pages.So I made an experiment – here is the sequence of activities and the result:
1) cart is empty, no members area is logged
2) order product 1 from a public page – in shopping cart is product 1
3) login at members area 1 – in shopping cart is product 1
4) further order – product 2 from a public page – in shopping cart is product 1 and 2
5) logout at members area 1 – the shopping cart is empty
6) login at members area 1 – the 2 products are in the shopping cart
7) logout – shopping cart is empty
8) login at an other members area – empty shopping cart
9) logout – cart empty
10) login at members area 1 – in shopping cart is product 1 and 2It seems the orders (whether before or after login) are linked to the members area.
July 1, 2022 at 1:27 pm #24057admin
KeymasterHi, The plugin’s standard logout normally has no bearing on the shopping cart (unless the cart is connected to the WP user). There may be some kind of conflict (server configuration or other plugins or theme related conflict). First, try the following:
https://simple-membership-plugin.com/forums/topic/test-for-plugin-and-theme-conflict-before-posting-an-issue-or-a-bug/July 5, 2022 at 8:03 am #24067Rynhrd
ParticipantHi again… 😉
I made a brandnew WordPress site for tests…:
Wordpress: Version 6.0.
Theme: Storefront
Woocommerce: Version 6.6.1
PHP: Version 7.3
Plugins: WooCommerce, Simple WordPress Membership, Simple Membership After Login Redirection, SWPM Partial Protection, SWPM Misc ShortcodesAll is downloaded and installed today, so the theme and the plugins should be the current…
[deleted some sensitive information after troubleshooting]
There is the same: when I login and add a product to the cart (no matter if it is the product from the partial protected page – item “Product 1” – or from the shop – item “Product 2”) the cart is empty after logout.
After login the items in the cart are there…July 5, 2022 at 8:06 am #24074admin
KeymasterLooks like woocommerce made a change to connect the cart to a WP user. So when WP user logs out, they empty the cart for that user. Do the following test and you will see that it has nothing to do with our simple membership plugin.
1) Temporarily deactivate our simple membership plugin (so you can isolate the behavior).
2) Log into a WP user account on a browser where you are not logged in as an admin. Just use the standard woocommerce account login (which uses WP user).
3) Add an item to the shopping cart.
4) Logout from the site using woocommerce account page or the WordPress’s standard logout option.
5) You will see that the cart is emptied.July 5, 2022 at 9:04 am #24078Rynhrd
ParticipantHi, thanks for the reply…
Hmmm, then a message “shopping cart will be deleted with logout” or something similar should suffice…Thanks for deleting the sensitive info in my last post, I didn’t know how else to share this info.
Can you please also delete the URL of my test system…?!Next I will integrate and test the “WooCommerce Payment Integration” plugin, I’m already excited… 😉
-
AuthorPosts
- You must be logged in to reply to this topic.