Cart add.js responds successfully but item is not added to cart

KrisAtVerbidio
New Member
2 0 0

I am using the AJAX add to cart (add.js) method. About 5% of the time we are seeing that the item doesn't actually get added to the cart.

Digging more, I'm seeing a successful response come back from the API, but the cart comes back as empty.

Fri, 19 Feb 2021 02:22:55 GMT
{id: 32534378086451, properties: null, quantity: 1, variant_id: 32534378086451, key: "32534378086451:6bdc22163e9e20c903deec1ab3600316", …}

What might be causing /cart/add.js to return a success but not actually adding the item to the cart?

0 Likes
KrisAtVerbidio
New Member
2 0 0

Bump. Hoping that at least someone at Shopify can help me understand why your API is saying the product was added but the cart was empty. Support shut me down and told me they can't help me and pointed me here, so I'm at a complete loss with no visibility to your backend.

0 Likes
syf_
Shopify Staff
Shopify Staff
54 11 9

Hey @KrisAtVerbidio,

If you can provide me with an x-request-id (found in the response header) of a response from not older than 10 days, I could try looking into this for you.

Thanks,
Seth.

syf_ | 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

0 Likes