You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It is not very clear how the react cart component knows what cart to retrieve. There is a note about a path paramenter, but I could not find details describing what that parameter should be called or how to implement.
How can this issue be resolved?
Update to reflect suggested implementation
...
Are you interested in working on this issue?
I would like to fix this issue
The text was updated successfully, but these errors were encountered:
As mentioned in the create a cart section, the cart ID is saved in the localstorage. So, in your code you can check for it whenever necessary (such as to retrieve the cart). Once the order is placed or the customer logs out, you have to clear the cart ID from the local storage (which is also mentioned in the retrieve cart section.)
@shahednasser I guess what was unclear is that vanilla JS code example, the user has to pass a cart_id which matches the ID saved in the previous step you mention. In the ReactJS code, there is no reference to how the hook interacts with the local variable. Does it need to be the variable same name? Can I pass a different name? Do I need to use a separate hook to get the cart using the ID then can use the cart object?
As someone who is reading the docs and trying to put it all together, this is not clear to me. If you feel this is all implied and obvious, feel free to leave unchanged.
Preliminary Checks
Issue Summary
https://docs.medusajs.com/modules/carts-and-checkout/storefront/implement-cart
It is not very clear how the react cart component knows what cart to retrieve. There is a note about a path paramenter, but I could not find details describing what that parameter should be called or how to implement.
How can this issue be resolved?
...
Are you interested in working on this issue?
The text was updated successfully, but these errors were encountered: