Page 1 of 1

R11 how to merge anonymous basket into registered basket

Posted: Sat Mar 12, 2016 3:43 pm
by AbleMods
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.

Re: R11 how to merge anonymous basket into registered basket

Posted: Mon Mar 14, 2016 12:37 am
by mazhar
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.

Re: R11 how to merge anonymous basket into registered basket

Posted: Mon Mar 14, 2016 1:31 am
by AbleMods
K so do I just do a basketitem.cooy() and add that to the target collection?

Re: R11 how to merge anonymous basket into registered basket

Posted: Mon Mar 14, 2016 1:45 am
by mazhar
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.