Discuss and resolve questions on Liquid, JavaScript, themes, sales channels, and site speed enhancements.
I've recently noticed when the cart/add.js endpoint receives a request to add more items to the cart than in stock, it returns an error but at the same time it adds all available stock to the cart!
So if you have an empty cart, and you have only 3 item in stock for a specific SKU, and you send a request to add 4 items of this variant to the cart, you'll get an error (which is expected), but at the same time all 3 available items will get into your cart!
It looks like a bug of the cart/add.js endpoint, as when an endpoint returns an error message, it shouldn't perform any actions.
This bug/feature isn't handled in the Dawn theme even.
Do we know if this is a bug of the add.js endpoint and it will be fixed soon, or it is a "feature" that will stay with us.
The same thing is happening with the "change.js" endpoint!
If you set the new quantity to be higher than in stock, it will return an error but it will actually add all available quantity to the cart!
Hi,
Did you find any solution for this I am also looking the solution of this issue.
If you having the 3 items in stock and added 4 simultaneously then dawn theme is failed to load the cart drawer but upon refresh the page 3 item already added in cart.
Any solution for this.
Discover how to increase the efficiency of commerce operations with Shopify Academy's l...
By Jacqui Mar 26, 2025Shopify and our financial partners regularly review and update verification requiremen...
By Jacqui Mar 14, 2025Unlock the potential of marketing on your business growth with Shopify Academy's late...
By Shopify Mar 12, 2025