I am developing a Shopify store using their API. But I have hit a rather large snag that seems simple, but I can't fix.
I have successfully viewed all products and their variants. I can also add a product/variant to the cart. It is "successful" because I am getting a status of 200 AND I can see what products are getting added with my Shopify account. Everything on that end is working.
When I call the cart with GET request I am able to see the cart, but it is completely empty (item_count: 0). I have tried adding different products/variants. It is always empty.
Am I missing something? Do I need to call the cart another way?
Thanks in advance!
When you GET cart.js, and your item count is zero, it means you failed to place anything in the cart. When you do place items in the cart, and you validate they are actually in the cart, and you do a GET on cart.js, if that call is still empty, then you are really really unlucky and are probably just making a really dumb mistake in your GET call.
Didn't find the answer?
Our community is visited by hundreds of Shopify development professionals every day. Ask your question and get a quick answer for free.
Find the answer in similar questions on our website.
Write quick answer
Do you know the answer to this question? Write a quick response to it. With your help, we will make our community stronger.