简体   繁体   中英

GET cart.js empty | shopify

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM