If stock level exceeded, nothing gets added to cart.

Solved

If stock level exceeded, nothing gets added to cart.

sergio-silva
Tourist
6 0 4

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=4867...

 

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

 

 

Accepted Solution (1)

tim
Shopify Partner
3911 395 1440

This is an accepted solution.

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;
}

 

If my post is helpful, consider liking it -- it will help others with similar problem to find a solution.
I can be reached via e-mail tairli@yahoo.com

View solution in original post

Reply 1 (1)

tim
Shopify Partner
3911 395 1440

This is an accepted solution.

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;
}

 

If my post is helpful, consider liking it -- it will help others with similar problem to find a solution.
I can be reached via e-mail tairli@yahoo.com