R11 how to merge anonymous basket into registered basket

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

R11 how to merge anonymous basket into registered basket

Post by AbleMods » Sat Mar 12, 2016 3:43 pm

When a user logins in, their anonymous basket contents replace their registered user basket contents. I have a client who wants the anonymous basket merged into the registered user basket so that no potential sales are lost. Their shoppers tend to build large baskets (20+ items) so this is a big deal to them.

I tried changing .Migrate(), but wound up causing more problems than I solved.

Is there an easier way to accomplish this? We have full source code.
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: R11 how to merge anonymous basket into registered basket

Post by mazhar » Mon Mar 14, 2016 12:37 am

You should try to extend BasketService and override its Transfer method. There you can ensure to copy over the basket items instead of deleting target items.

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

Re: R11 how to merge anonymous basket into registered basket

Post by AbleMods » Mon Mar 14, 2016 1:31 am

K so do I just do a basketitem.cooy() and add that to the target collection?
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: R11 how to merge anonymous basket into registered basket

Post by mazhar » Mon Mar 14, 2016 1:45 am

Yes something like that. This copy thing can also be tried in front end codes before calling migrate. Just copy over the basket items to new user's basket before calling migrate.

Post Reply