Page 1 of 1

How to save basket when anonymous logs in to registered?

Posted: Thu Sep 22, 2016 9:53 am
by AbleMods
We have multiple clients who have the following scenario:
Shopper browses and shops the site anonymous and adds items to the basket
Shopper reaches checkout, realizes they have a registered user account
Shopper logs into registered account.

Shopper's anonymous basket is now gone, replaced with the basket from the last time they shopped while logged in.

How can we migrate anonymous baskets (merge) to a registered user account?

Re: How to save basket when anonymous logs in to registered?

Posted: Fri Sep 23, 2016 12:30 am
by jmestep
Not an answer, but confirming that we have seen that problem also. We have also seen a customer's basket disappear if an admin logs in as a user, puts items in basket, goes back and logs in to the admin without closing the browser or clicking the log out link first. User's basket get transferred to the admin.

Re: How to save basket when anonymous logs in to registered?

Posted: Fri Sep 23, 2016 2:24 am
by Katie
Issue reported AC8-3201: Basket contents should merge if anonymous shopper logs into their account

I wish I could remember how we handled this in AC7. I feel that by "merging" the two baskets we need to notify the customer that the action took place after they logged in.

Thanks
Katie

Re: How to save basket when anonymous logs in to registered?

Posted: Fri Sep 23, 2016 5:52 am
by AbleMods
Katie wrote:I feel that by "merging" the two baskets we need to notify the customer that the action took place after they logged in.
Honestly, the client's I've discussed this point with have all said the same thing - hat notification is a very low priority to them. They just want the contents retained so they aren't lost. If there's duplication, so be it.

Better to sell to much than nothing at all.

Re: How to save basket when anonymous logs in to registered?

Posted: Fri Sep 23, 2016 6:03 am
by Katie
If there is a case where the product is already in both baskets, then I think it would be better to have it added to the registered basket rather than try to decide which one to keep. Especially if there are products with options or kits. That is why I thought that some kind of notification should be shown. Anyway, it is just a suggestion at this point. The developers can decide the best way to handle the merge.

Thanks,
Katie

Re: How to save basket when anonymous logs in to registered?

Posted: Sun Sep 25, 2016 11:11 pm
by mazhar
Joe isn't it already happening in Gold? In my test and if a I look at BasketService.Transfer method I can see we always overwrite basket with the one from anonymous user.

Re: How to save basket when anonymous logs in to registered?

Posted: Mon Sep 26, 2016 8:57 am
by AbleMods
mazhar wrote:I can see we always overwrite basket with the one from anonymous user.
No you're doing the opposite of what I describe.

Try it this way:
Log in as a registered user. Shop the store, add a few items to your basket.

Now log out. Your basket is empty, you're now anonymous. Your registered user basket should still be intact with your registered user account.

Shop the site, add a few items to your anonymous basket. Make sure they are DIFFERENT items from what you added when you were logged in.

Now log in. Your registered user basket from the last time you were logged in is wiped out, and it is replaced with the basket contents of your anonymous session.

We want the basket contents merged so no items are lost.

Re: How to save basket when anonymous logs in to registered?

Posted: Tue Sep 27, 2016 9:02 pm
by mazhar
From title I thought that you wanted to use replace registered user's basket with one from anonymous user which is happening right now. If you want to merge the basket then you can extend BasketService and override its Transfer method. In there you will copy contents from target basket to source basket before deleting target basket. This will merge the contents from both baskets. Finally using windsor you hook your custom basket service into application.

Re: How to save basket when anonymous logs in to registered?

Posted: Tue Sep 27, 2016 10:28 pm
by AbleMods
You know you want to write it for me to show off your leet skills!!

Re: How to save basket when anonymous logs in to registered?

Posted: Wed Sep 28, 2016 3:02 am
by Katie
It's interesting how Amazon handles this scenario.

Let's say you are a registered user with some existing items in the basket (eg. shirt and pants). Go to Amazon's site and make sure you are logged out. Add an item to the cart (eg. shoes). Then login to place the order, since they don't offer guest checkout. What happens is that the cart of the registered user is ignored and you can skip the basket and checkout with only the one item (eg. shoes). However, if you stop during checkout and return to the basket, you will see all 3 items (eg. shirt, pants, shoes).

To me, it only makes sense that the customer should be aware of what they are trying to purchase. If we just automatically combine two baskets, then we really need to make that obvious to the customer or they may be wondering what the heck just happened. Perhaps a simply pop-up window. Something like this:

"You have existing items in your shopping cart. Do you wish to combine them into one order or replace them with your current basket?"

Thanks,
Katie

Re: How to save basket when anonymous logs in to registered?

Posted: Thu Sep 21, 2017 2:26 am
by Shopping Cart Admin
Hi All,

Just tested it in 7.0.5 and we overwrote the logged in basket with the anon basket contents on login. In 5.5 we merged the two together, not sure why that decision was made.

Re: How to save basket when anonymous logs in to registered?

Posted: Thu Sep 28, 2017 4:19 am
by deverill
I would think that if the "registered user basket" has items it would have been from a few hours/days ago. If I had some stuff left over in my basket from another visit and then came back anonymously I'd rather just keep my current basket when I logged in and trash the old stuff, but that's just me.

Could you modify the login script to check for a basket before logging in and adding those items to the logged-in basket?

Jim

Re: How to save basket when anonymous logs in to registered?

Posted: Fri Sep 29, 2017 1:00 am
by Katie
Could you modify the login script to check for a basket before logging in and adding those items to the logged-in basket?
Don't hold me to it, but I do believe this is what we are planning to do in a future release. While logging in, I'd like to see an intermediate screen offer the customer a choice of 1) merging both baskets, 2) keep new basket, or 3) use the saved basket.

Re: How to save basket when anonymous logs in to registered?

Posted: Mon Oct 02, 2017 1:48 am
by deverill
Katie wrote:While logging in, I'd like to see an intermediate screen offer the customer a choice of 1) merging both baskets, 2) keep new basket, or 3) use the saved basket.
I like that! A great solution to cover all bases.

Re: How to save basket when anonymous logs in to registered?

Posted: Mon Oct 02, 2017 2:50 am
by AbleMods
Or, just support multiple baskets.

The data classes have supported it for 10 years, yet it's never been implemented in the UI.