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!
Thanks to everyone who participated in our AMA with 2H Media: Marketing Your Shopify St...
By Jacqui Sep 6, 2024The Hydrogen Visual Editor is now available to merchants in Shopify Editions | Summer '...
By JasonH Sep 2, 2024Note: Customizing your CSS requires some familiarity with CSS and HTML. Before you cust...
By JasonH Aug 12, 2024