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

How can I obtain the current cart for a customer if my site does not require login?

How can I obtain the current cart for a customer if my site does not require login?

atwoodr41
Shopify Partner
3 1 0

I am developing a Shopify app that sets prices dynamically.  When a user selects their inputs and the product(s) they want to buy, I want to use the storefront API to add this new item to the customer's cart with a dynamic price.

 

However, from the documentation it appears that in order to obtain the existing cart (to see if they already have any items in their cart at the moment) I can only obtain that by specifying a username (email) / password for the current user. 

 

Since we don't anticipate requiring logins for our site, how can I determine / retrieve the current user's cart?  Is the only way for me to do this to track the cart id associated with the current session with my own custom logic?

Replies 0 (0)