If stock level exceeded, nothing gets added to cart

Hi and thank you in advance for your help,

I’m having an issue with my product page,

for instace, a certain item has only 3 in stock,

if someone adds 4 to the quantity, nothing happens.

I believe it should say, something like please select a lower quantity.

please help,

https://patersontattoo.com/

this is a perfect item to mimik the issue:

https://patersontattoo.com/collections/ink/products/eternal-tattoo-ink-lipstick-red-e41?variant=48676702290236

if you try to add more than 3, nothing happens

but if you select 3, thats when they get added,

some kind of warning box, or notification box should be displaying.

Thank you

1 Like

Your theme has this functionality.

However, there are 2 problems:

First, in your assets/shop.js find function doAjaxAddToCart and inside this function there is this code:

$(".ajax-error-message").text(e.parseJSON(n.responseText).description);

this should be

$(".ajax-error-message").text($.parseJSON(n.responseText).description);

e → $

This should bring your error message box back.

However, contents of the box are white text on white background – probably something you can change in the theme settings.
Or can add the following to the very bottom of your frame.scss(.liquid ?) asset:

.ajax-error-modal .modal-inner {
  color: red;
}
1 Like