Iv'e searched high and low on answers how to use add items to Cart. I'm building a headless storefront (challenging, I know), and I need to understand how the items are being added to Cart.
I've look here and see no mentioning of "Cart". My backend for this setup is using the Ruby gem.
Based on how I see carts work, a customer, authenticated or not, can add something to cart, they can refresh their browser and it's still there so something unique is happening and I see no documentation on how to "add to cart".
Solved! Go to the solution
This is an accepted solution.
Hi @MayneWeb
I don't know if this is the exact solution. I'm guessing Shopify manages Cart by storing the information about products in browser cookies and then creates checkout at the backend once the user proceeds for checkout. You can do similarily, here is the doc for storefront checkout API https://help.shopify.com/en/api/storefront-api/guides/checkout-guide#creating-the-checkout
This is an accepted solution.
Hi @MayneWeb
I don't know if this is the exact solution. I'm guessing Shopify manages Cart by storing the information about products in browser cookies and then creates checkout at the backend once the user proceeds for checkout. You can do similarily, here is the doc for storefront checkout API https://help.shopify.com/en/api/storefront-api/guides/checkout-guide#creating-the-checkout
So it seems like you are suggesting that a headless store should maintain and manage their own cart, and only rely on shopify when the user is going to "checkout" and pay... am I clear on that?
it seems @MayneWeb is trying to implement using the shopify native cart. (only product pages are headless, and add to cart ideally sends them to the shopify hosted cart).
User | RANK |
---|---|
17 | |
17 | |
16 | |
14 | |
12 |