KonaKart Community Forum

Installation / Configuration => Programming of KonaKart => Topic started by: michaelwechner on July 23, 2010, 03:14:19 pm

Title: Transfering a filled shopping cart form a temp user to a registered user
Post by: michaelwechner on July 23, 2010, 03:14:19 pm
Hi

Before a user is registered or signed-in I use

getTempCustomerId()

in order to attach a shooping cart, e.g.

Session ID: be9a3bceb5837622d4d6cc44a079ae3c (based on a temporary user created within forceRegisterCustomer)
Customer ID: -107

but at some point the customer will register or sign-in:

String konakartSessionID = kkEngine.login(username, password);

but here it is not clear to me how to transfer the filled shopping cart to the signed-in user, because
first the above method does not seem to have any connection to the previous session, but rather creates a new session (btw. in my case the login() method returns an empty string) and second I have used the negative customer ID to add items to the shopping cart.

Any pointers are much appreciated.

Thanks

Michael
Title: Re: Transfering a filled shopping cart form a temp user to a registered user
Post by: michaelwechner on July 23, 2010, 04:01:17 pm
thinking some more about it I currently see two possibilities:

- Either keep the negative customer ID as a reference to the shopping cart
- Or copy/paste the shopping (items and quantities) from the negative customer Id to the new session ID

Cheers

Michael
Title: Re: Transfering a filled shopping cart form a temp user to a registered user
Post by: trevor on July 26, 2010, 10:01:39 pm
You should use the mergeBaskets() API call.
Title: Re: Transfering a filled shopping cart form a temp user to a registered user
Post by: michaelwechner on July 27, 2010, 01:59:34 pm
Thanks very much for poniting this out, whereas IIUC this will make the shopping items persistent (independent of the session), but which in our case is not wanted.

Thanks

Michael