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

Removing cart from session resulting into deleting the cart from DB

Former Member
0 Kudos
1,184

Hi Experts,

I am using Hybris 6.6 B2B recipe and working on Saved Cart functionality.

I am saving the current cart using ModelService.save() method and then removing this cart from session using OOTB code - getSessionService().removeAttribute(DefaultCartService.SESSION_CART_PARAMETER_NAME).

I am removing this cart from session because I want to create a new empty cnd assign it to session (This code is working fine)

Problem : Once I remove the cart from session, the cart is deleted from the DB and I am not able to reuse the saved cart further.

All answers are appreciated. 🙂

Thanks!

Accepted Solutions (0)

Answers (1)

Answers (1)

crescenzorega
Active Participant
0 Kudos

Hi, try to overwrite it

getSessionService().setAttribute(DefaultCartService.SESSION_CART_PARAMETER_NAME, new Cart)