Author Topic: Transfering a filled shopping cart form a temp user to a registered user  (Read 514 times)

michaelwechner

  • Sr. Member
  • ****
  • Posts: 110
    • View Profile
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

michaelwechner

  • Sr. Member
  • ****
  • Posts: 110
    • View Profile
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

trevor

  • Administrator
  • Hero Member
  • *****
  • Posts: 495
    • View Profile
    • KonaKart
You should use the mergeBaskets() API call.

michaelwechner

  • Sr. Member
  • ****
  • Posts: 110
    • View Profile
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