How can we access or override what cart this is? Surely you should be able to pass a cart key into this?
Hi @Tom_Hooker,
Can you provide some more context on what you’re asking about exactly? Is there any specific API calls you’re referring to, or documentation you’re following that you need help with?
In general, you can query specific carts by cart id (including the key), using the Storefront API. This will return the cart object associated with that id, and allow you to send customers to the checkout for this cart with the checkoutUrl field on the cart object.
Sorry, thought i did ![]()
Yeah this cart: shopify-cart
Seems a bit counter productive you cant put a cart id/key. So at the moment it looks like its creating a cart behind the scenes which we cant control or change if needed
No worries at all, thanks for providing the context!
I can confirm that the Storefront Web Components does not support querying specific carts using the cart id at this time.
I will definitely be submitting some feedback on your behalf internally here, as we do take all our merchant and partner feedback with great value when determining future platform features and updates.
In the meantime, since the Storefront Web Components does use the Headless Channel and is essentially powered by the Storefront API, you can still use the Storefront API on your external website to create, manage, and retrieve carts manually, which does allow you to work with specific carts based on their cart id.
Here’s some Shopify.dev documentation with more information on working with Carts and the Storefront API directly.