on 09-10-2018 11:30 AM
Hi All
I had a requirement to remove the session cart once the cart is saved for future. Is there any ootb strategy to remove the session cart once the cart is saved. Please let me know the recommended way to so.
Hi Gopi,
Please is below code meets your requirements:
getSessionService().removeAttribute(DefaultCartService.SESSION_CART_PARAMETER_NAME);
Best Regards,
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
if you do not want to use getSessionService().removeAttribute(DefaultCartService.SESSION_CART_PARAMETER_NAME);
to remove cart from session you can create a new empty cart and set in session by using (de.hybris.platform.order.impl.DefaultCartService).setSessionCart()
It will remove cart from session with out deleting.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
8 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.