Getting Cart total with Storefront API

MikeSayenko
New Member
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)