Our Partner & Developer boards on the community are moving to a brand new home: the .dev community forums! While you can still access past discussions here, for all your future app and storefront building questions, head over to the new forums.

We're moving the community! Starting July 7, the current community will be read-only for approx. 2 weeks. You can browse content, but posting will be temporarily unavailable. Learn more

Getting Cart total with Storefront API

Getting Cart total with Storefront API

MikeSayenko
Visitor
1 0 0

We are building a WordPress website and will have the Shopify site in a sub folder. The WordPress site will have a "cart icon" in the main menu. 

 

I was told by Shopify support in order to update the "cart total" on the WordPress site I'd need to use the Storefront API. 

 

I was able to get the Storefront API working, and found an example which just grabs a few products. What I can't find though is the "query" needed to grab the cart.

 

This is my working code: https://gist.github.com/iamcanadian1973/644387819cba2edac0947560d79f55e0

 

Can someone help? 

 

Thank you.

Replies 0 (0)