Dedicated to the Hydrogen framework, headless commerce, and building custom storefronts using the Storefront API.
We're on Plus and have a customized checkout.liquid wherein we offer an in-checkout product upsell. This works by using cart.js endpoints to add the product/variant to cart. However, we noticed when creating and redirecting to checkouts created using the Storefront API, cart.js still updates the *main site cart* and not the checkout cart (i.e. line items).
I don't see in the docs how to change the checkout/cart contents for the *current* checkout. Any insight is appreciated.
Hey @kyleparade!
Have you looked at the the checkoutLineItemsReplace (/Add/Remove/Update) mutations in the Storefront API yet?
CalD | Developer Support @ Shopify
- Was my reply helpful? Click Like to let me know!
- Was your question answered? Mark it as an Accepted Solution
- To learn more visit Shopify.dev or the Shopify Web Design and Development Blog
Any ideas? This is specifically to be able to manipulate the cart/checkout you would access by browsing our storefront, *not* a checkout created via API. The cart.js blocks cross origin requests even from a subdomain of our store, so that won't work. Looking forward to your reply.
Hey @kyleparade,
I don't believe this is possible. Check out this similar forum thread: https://community.shopify.com/c/Shopify-APIs-SDKs/How-do-I-use-the-AJAX-API-in-a-headless-Shopify-Re...
CalD | Developer Support @ Shopify
- Was my reply helpful? Click Like to let me know!
- Was your question answered? Mark it as an Accepted Solution
- To learn more visit Shopify.dev or the Shopify Web Design and Development Blog