Hey guys, I am working on a cart and I am trying to determine if a max quantity is reached.
For example, when a customer clicks on the “Add to Cart” button, that one uses the add.js call, and if the user already has the max quantity in his cart, it returns a 422 status code, saying that max quantity is reached.
However, if the customer clicks on the + button in the cart to increase quantity, I am using the change.js call to increase (or decrease) the quantity, but once I reach the max quantity, it no longer increases, but it still returns status 200 as if everything is fine, and I have no way of detecting wether max quantity is reached with change.js. No way that I can find in the cart API documentation https://shopify.dev/docs/themes/ajax-api/reference/cart
So how do I determine wether a max quantity is reached with change.js?
I have just tried to do it with the update.js, and that is even allowing me to update the cart to quantities that are not available (for example, available quantity is 4, I got it up to 12!)! Still no errors.