65 votes
0 answers
Shopify - How to programmatically add a product to a cart with a custom app extension?
Solution:
how do I add an item to the cart?
Check out the Shopify AJAX API (https://shopify.dev/docs/api/ajax). The cart reference documentation (https://shopify.dev/docs/api/ajax/reference/cart) details how to query for what items are already in the cart and how to add items.
Admin API? Would I be using GraphQL?
No. The endpoints under these APIs require authentication so definitely don't use them client side from the storefront.
Undefined asked
Source
Didn't find the answer?
Our community is visited by hundreds of Shopify development professionals every day. Ask your question and get a quick answer for free.
Similar questions
Find the answer in similar questions on our website.
Write quick answer
Do you know the answer to this question? Write a quick response to it. With your help, we will make our community stronger.