A Shopify store owner encountered an issue where customers could add more items to their cart than available inventory, despite receiving a generic error message that didn’t specify the actual stock quantity.
Initial Solutions Provided:
Verify inventory tracking is enabled in Shopify Admin > Products > Inventory
Ensure “Continue selling when out of stock” is unchecked
Add an inventory quantity display block to the product template (available in Dawn theme)
Technical Fix (Dawn/Studio Themes):
A working solution involves editing the main-product.liquid file in the theme’s sections folder by adding max attributes to the quantity-input element:
I have keyfob wristlets listing in my store with 11 variants. I have the stock set to what I have on hand in the backend, but when I test on the front end I’m able to add way more quantity than what is available. I do see an error message come up that says “You can’t add more PRODUCT NAME to the cart” but it doesn’t alert the customer of what the actual amount is on hand.
How can I keep customers from adding more of one item in the cart that exceeds the quantity on hand, and/or how can I show the customer the exact quantity on hand?
There are a few reasons why you could be experiencing overselling. Could you please check the following:
Enable Inventory Tracking:
Ensure that inventory tracking is enabled for your products.
Go to your Shopify Admin > Products > Select the product > Inventory.
Check the box for “Track quantity.”
In the same Inventory section, make sure the “Continue selling when out of stock” option is unchecked. This will prevent customers from purchasing more than what is available.
I’m using the Studio Theme. I found the inventory block and added it advice the quantity picker. It’s a start, but I would really want that quantity picker to stop at the quantity on hand and go no further.
I couldn’t update/delete my review.
I wanted to edit part about message not showing. Message is showing in
default template, BUT it doesn’t in my version. I think it might be caused
by a missing translation, but I wasn’t able to find where to put
translation for this message.
I will try your code, but if you know where the translation could be
found and it isn’t not a problem for you, could you please point me in the
right direction?
Thank you!
p.s.
If there is a way to edid review please let me know.
I really like this theme, good job guys!
It seems that it might be a translation problem, because in default
template it works fine.
Problem I’m having now is that I can’t locate this exact translation in
settings.
Hi. The solution worked just fine, but there is one more thing needs to be done. I am still able to edit the quantity. it needs to be non- editable pls. can you suggest the solutin in the same way as you did.with snip pls. Thnaks much-