How to save basket when anonymous logs in to registered?

For general questions and discussions specific to the AbleCommerce GOLD ASP.Net shopping cart software.
Post Reply
User avatar
AbleMods
Master Yoda
Master Yoda
Posts: 5170
Joined: Wed Sep 26, 2007 5:47 am
Location: Fort Myers, Florida USA

How to save basket when anonymous logs in to registered?

Post by AbleMods » Thu Sep 22, 2016 9:53 am

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?
Joe Payne
AbleCommerce Custom Programming and Modules http://www.AbleMods.com/
AbleCommerce Hosting http://www.AbleModsHosting.com/
Precise Fishing and Hunting Time Tables http://www.Solunar.com

User avatar
jmestep
AbleCommerce Angel
Posts: 8164
Joined: Sun Feb 29, 2004 8:04 pm
Location: Dayton, OH
Contact:

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

Post by jmestep » Fri Sep 23, 2016 12:30 am

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.
Judy Estep
Web Developer
jestep@web2market.com
http://www.web2market.com
708-653-3100 x209
New search report plugin for business intelligence:
http://www.web2market.com/Search-Report ... -P154.aspx

User avatar
Katie
AbleCommerce Admin
AbleCommerce Admin
Posts: 2651
Joined: Tue Dec 02, 2003 1:54 am
Contact:

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

Post by Katie » Fri Sep 23, 2016 2:24 am

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
Thank you for choosing AbleCommerce!

http://help.ablecommerce.com - product support
http://wiki.ablecommerce.com - developer support

User avatar
AbleMods
Master Yoda
Master Yoda
Posts: 5170
Joined: Wed Sep 26, 2007 5:47 am
Location: Fort Myers, Florida USA

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

Post by AbleMods » Fri Sep 23, 2016 5:52 am

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.
Joe Payne
AbleCommerce Custom Programming and Modules http://www.AbleMods.com/
AbleCommerce Hosting http://www.AbleModsHosting.com/
Precise Fishing and Hunting Time Tables http://www.Solunar.com

User avatar
Katie
AbleCommerce Admin
AbleCommerce Admin
Posts: 2651
Joined: Tue Dec 02, 2003 1:54 am
Contact:

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

Post by Katie » Fri Sep 23, 2016 6:03 am

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
Thank you for choosing AbleCommerce!

http://help.ablecommerce.com - product support
http://wiki.ablecommerce.com - developer support

User avatar
mazhar
Master Yoda
Master Yoda
Posts: 5084
Joined: Wed Jul 09, 2008 8:21 am
Contact:

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

Post by mazhar » Sun Sep 25, 2016 11:11 pm

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.

User avatar
AbleMods
Master Yoda
Master Yoda
Posts: 5170
Joined: Wed Sep 26, 2007 5:47 am
Location: Fort Myers, Florida USA

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

Post by AbleMods » Mon Sep 26, 2016 8:57 am

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.
Joe Payne
AbleCommerce Custom Programming and Modules http://www.AbleMods.com/
AbleCommerce Hosting http://www.AbleModsHosting.com/
Precise Fishing and Hunting Time Tables http://www.Solunar.com

User avatar
mazhar
Master Yoda
Master Yoda
Posts: 5084
Joined: Wed Jul 09, 2008 8:21 am
Contact:

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

Post by mazhar » Tue Sep 27, 2016 9:02 pm

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.

User avatar
AbleMods
Master Yoda
Master Yoda
Posts: 5170
Joined: Wed Sep 26, 2007 5:47 am
Location: Fort Myers, Florida USA

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

Post by AbleMods » Tue Sep 27, 2016 10:28 pm

You know you want to write it for me to show off your leet skills!!
Joe Payne
AbleCommerce Custom Programming and Modules http://www.AbleMods.com/
AbleCommerce Hosting http://www.AbleModsHosting.com/
Precise Fishing and Hunting Time Tables http://www.Solunar.com

User avatar
Katie
AbleCommerce Admin
AbleCommerce Admin
Posts: 2651
Joined: Tue Dec 02, 2003 1:54 am
Contact:

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

Post by Katie » Wed Sep 28, 2016 3:02 am

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
Thank you for choosing AbleCommerce!

http://help.ablecommerce.com - product support
http://wiki.ablecommerce.com - developer support

User avatar
Shopping Cart Admin
AbleCommerce Admin
AbleCommerce Admin
Posts: 3055
Joined: Mon Dec 01, 2003 8:41 pm
Location: Vancouver, WA
Contact:

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

Post by Shopping Cart Admin » Thu Sep 21, 2017 2:26 am

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.
Thanks for your support

Shopping Cart Guru
AbleCommerce.com
Follow us on Facebook

User avatar
deverill
Lieutenant (LT)
Lieutenant (LT)
Posts: 64
Joined: Tue Jan 06, 2009 11:58 am
Location: Key West, FL
Contact:

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

Post by deverill » Thu Sep 28, 2017 4:19 am

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
Jim Sewell - Web Programmer
Trusted Tours & Attractions

User avatar
Katie
AbleCommerce Admin
AbleCommerce Admin
Posts: 2651
Joined: Tue Dec 02, 2003 1:54 am
Contact:

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

Post by Katie » Fri Sep 29, 2017 1:00 am

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.
Thank you for choosing AbleCommerce!

http://help.ablecommerce.com - product support
http://wiki.ablecommerce.com - developer support

User avatar
deverill
Lieutenant (LT)
Lieutenant (LT)
Posts: 64
Joined: Tue Jan 06, 2009 11:58 am
Location: Key West, FL
Contact:

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

Post by deverill » Mon Oct 02, 2017 1:48 am

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.
Jim Sewell - Web Programmer
Trusted Tours & Attractions

User avatar
AbleMods
Master Yoda
Master Yoda
Posts: 5170
Joined: Wed Sep 26, 2007 5:47 am
Location: Fort Myers, Florida USA

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

Post by AbleMods » Mon Oct 02, 2017 2:50 am

Or, just support multiple baskets.

The data classes have supported it for 10 years, yet it's never been implemented in the UI.
Joe Payne
AbleCommerce Custom Programming and Modules http://www.AbleMods.com/
AbleCommerce Hosting http://www.AbleModsHosting.com/
Precise Fishing and Hunting Time Tables http://www.Solunar.com

Post Reply