I am trying to get the cart by REST call. though I am providing oauth token and setting JSESSIONID as cookie but each time I am getting a new empty cart instead of the saved cart.
Any help in this regard is appreciated.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Infact when I am calling the cart for first time I am getting an empty cnd after adding one product to cart ,then if I call view cart then I am getting all cart details which was added before and saved.
So if I want to view cart which earlier saved how can I do that through web service?
can you post your code, an empty cart is always created when we call getCart(). We should always check if hasCart() is returning false to call getCart() in hybris. But you are saying you call a RESTful webservice, need a bit more details on it
I am calling cartFacade.getSessionCart() which is out of box code,but for me hasCart() is reurning false always.
Should be this -
final CartData cartData = getCheckoutFacade().getCheckoutCart();
Can you please check this
If this returns false always, that means that the cart is not being created... try logging in as a registered user and add a product to the cnd log out and login again...
For RESTful webservices hybris is using Spring OAUTH2 concept for authentication. You need to send Oauth token. JSESSIONID will not work. That too you need to have commercewebservices and commercewebservicescommons as dependent modules.