cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Hybris issue with user change on session cart

2,209

Hi,

When guest user places order, in DefaultCustomerFacade guest user is created and assigned to session cart. Before this point, sessioncart contains 'anonymous user'.

if (getCartService().hasSessionCart()) { getCartService().changeCurrentCartUser(getUserService().getUserForUID(guestCustomerData.getUid())); }

Once createGuestUserForAnonymousCheckout method in DefaultCustomerFacade is executed, in same code flow,

1) we are fetching cart using cartService.getSessionCart(). Calling modelservice refresh on cart object.

2) fetching user from cart, calling modelservice refresh on user object, and adding address and other information to user.

We are facing issue in production environment where address is added to anonymous user but not to newly created guest user. We could see in database, guest user is created, but no cart assigned. All modifications applied on anonymous user and not on newly created guest user. This shows user is not changed for cart.

Is there any chance, hasSessionCart returns false but there is cart in session? We are facing this issue only some times and not happening for all users.

If any one have faced similar issue or any pointers, please help.

Recently we updated patch to 6.4.0.25 from 6.4.0.14

Accepted Solutions (0)

Answers (1)

Answers (1)

Private_Member_467521
Active Contributor
0 Kudos

Hi manesh.muthyala

I think this might be more a conceptual topic. Please take a look the post below and advise if you went all the way through the order check out.

https://answers.sap.com/questions/12753596/in-guest-checkout-order-is-placed-against-anonymou.html

Cheers,

Luis

0 Kudos

Hi Luis,

My sincere thanks for your response. We are facing issue(happening once in a while) once user clicks on place order. Guest user is getting created but in same code flow, address is getting associated to anonymous user but not newly created guest user.

Once OOB code creates user and assigns to cart( once after user clicks on place order),

- we are fetching cart from session and fetching user from cart. But it looks like anonymous user is returned in some cases.

We are fetching user from session cart once method createGuestUserForAnonymousCheckout() is executed.