Comments (3)
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.)
from medusa.
@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.
from medusa.
Can you specify which section you mean?
from medusa.
Related Issues (20)
- Weird race condition when updating a cart before initializing payment
- Illegal operation on a directory, open HOT 5
- Subscriber is not stable HOT 4
- Shipping Methods don't get listed for cart based on requirements
- tax_code missing results in tripple duplicated VAT lines
- Yarn Build fails.
- docs: fix subscriber getPresignedDownloadUrl logic in digital products recipe HOT 3
- Peer dependencies on medusajs/medusa
- Startup failure: current transaction is aborted, commands ignored until end of transaction block HOT 4
- BREAKING CHANGE: webpack < 5 used to include polyfills for node.js core modules by default. This is no longer the case. Verify if you need this module and configure a polyfill for it. HOT 1
- Docs(Code Issue): Code Issue in /admin/configuration HOT 1
- The browser opens undefined:7001 on a new project HOT 8
- 1.20.6 and 1.20.5 GraphQLError: Syntax Error: Unexpected <EOF>. HOT 1
- Drawer UI component in admin opens full screen
- Get api works on post or update api getting Cyclic dependency: "ProductCategory" TypeORMError: Cyclic dependency: "ProductCategory" HOT 5
- Events being lost in worker mode HOT 4
- Duplicated media using `medusa-plugin-contentful` HOT 1
- Token is not invalidated HOT 1
- How to add new Typesense plugin to plugin page? HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from medusa.