Unusual stock related messages when adding to cart

New Member
3 0 2

Hi there,

 

I have a product with 5 in stock. If I go to add 6 via ajax, the message the API gives back is:

 

You can't add more [product name] to the cart.

 

This seems a bit vague and impractical. Why doesn't it add all 5 and let you know the 6th couldnt? Or why doesn't it tell you how many are in stock? 

 

Thanks

1 Like
Excursionist
93 9 9

Hi mindpattern,
It depends on which theme are you using, you can show how many products left are in the store by coding your theme. Which theme are you using?

Let's make the best store!
Contact us at: thepremierstores@gmail.com
0 Likes
New Member
4 0 0

I had the same problem as you so I contacted support. The official response is that they removed this feature, even though it's currently what the documentation indicates the API should be doing.

 

If the product is entirely sold out, the error returned will say this:

The product #{item.name} is already sold out.

If the product is not sold out but the requested quantity exceeds what is available, yet at least 1 item can still be added to the cart, the error returned will specify how many more items can be added to the cart:

You can only add #{item.remaining_inventory} #{item.name} to the cart.

The #{item.remaining_inventory} value is equal to #{item.inventory_quantity} minus what's in the cart.

If the product is not sold out, but all of its stock is in the cart, the returned error will say:

All #{item.inventory_quantity} #{item.name} are in your cart.

 

This seems like a regression in functionality, so I'm not sure the motivation behind the change. In any case it's pretty disappointing that a change like this would be put into place without even updating the documentation.

0 Likes
Highlighted
Shopify Partner
189 13 21

@tdot 

On which URL and page you are facing the issue. Please let me know with the store URL? If you want privacy then you can send the message in private or mail or skype.

Thanks & Regards
Akshay Vaghasiya

Shopify Expert | E-commerce Consultant
Email: akshayvaghasiya84@gmail.com
Skype: akshayvaghasiya84
 - Want to modify or custom changes on store hire me .
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Mark it as an Accepted Solution
0 Likes