Not able to persist cart data #2310
Unanswered
rohitsarohamobi
asked this question in
Help
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi, I am using shopify/hydrogen to create a website. I ran into one problem while creating cart functionality. Let's say I added products on one device while I am logged in.
Then I try to login on another device but data returned from useCart() hook is not same as previous device the items differ for both the devices in cart.
Here is my cartProvider code
I have added one mutation also to update buyerIdentity in cart using customerAccessToken
My mutation seems to be working fine when I use useCart hook since I am able to see buyerIdentity coming up.
This is how I am getting from useCart() hook
const {lines} = useCart();
But when I try to login I get same customerAccessToken on different devices but why my line Items differ. Can anyone help me solve this issue.
Beta Was this translation helpful? Give feedback.
All reactions