Zero Inventory

I have a product with a few different product combinations (size and color of a shirt). When I try to add one of the shirts, say the white shirt is size medium, I get the message, “The T-Shirt has zero inventory and cannot be added to the cart”. The problem is when I am looking at the product page, I can see that there is a positive quantity, in this case, it says In Stock: 2 item(s).



What is the problem? Any ideas?

I thought of one minor thing to add to my question. With the various combinations, some of the combinations have a positive inventory amount, and a few have zero.



I don’t think that made a difference, because I tested the problem with all combinations having inventory in stock, and I still got this error.



Can someone please help?

Can someone please try to duplicate my error? Am I doing something wrong?

Hello mister,



Could you please send us a link referring to the place where this problem arose for you? I will do my best to help you with resolving it.

I have done some more digging into this issue and have found that if i have a product with just a size option, I am able to add it to the cart without issue. If I have a product with just a color option, I can also add it to the cart without issue.



The problem happens when I have a product with a size and a color. When I add both product options, I can no longer add the item to my cart.



Here is a link to the product in question:

[url]http://tinyblueorange.com/cscart/index.php?dispatch=products.view&product_id=4[/url]

After doing some digging, I found a bit more information.



Fist, I searched for ‘zero inventory’ in the /cscart directory which lead me to /cscart/install/database/data.sql. This SQL file inserts a record into the database for this error. Next, I searched for ‘text_cart_zero_inventory’ to find where it would be used, and that led me to /cscart/core/fn.cart.php line 1,762. Below is a snippet of that code:



```php

if ($current_amount > 0 && $current_amount - $amount < 0 && Registry::get(‘settings.General.allow_negative_amount’) != ‘Y’) {

$amount = $current_amount;

fn_set_notification(‘N’,fn_get_lang_var(‘notice’), str_replace(‘[product]’, $product[‘product’], fn_get_lang_var(‘text_cart_amount_corrected’)));

} elseif ($current_amount - $amount < 0 && Registry::get(‘settings.General.allow_negative_amount’) != ‘Y’) {

fn_set_notification(‘E’,fn_get_lang_var(‘notice’), str_replace(‘[product]’, $product[‘product’], fn_get_lang_var(‘text_cart_zero_inventory’)));

return false;

} elseif ($current_amount <= 0 && $amount <= 0 && Registry::get(‘settings.General.allow_negative_amount’) != ‘Y’) {

fn_set_notification(‘E’,fn_get_lang_var(‘notice’), str_replace(‘[product]’, $product[‘product’], fn_get_lang_var(‘text_cart_zero_inventory_and_removed’)));

return false;

}

```



It almost seems as if the $current_amount variable is not getting the correct value?

Can someone please confirm this error?

I have the same problem, I do track my items with options too and I really don’t want to change that since I have a script that updates these values according to channel advisor…



Can this issue be fixed, I just did a bigdump of the complete database, shouldn’t it work just the same ?



ZERO INVENTORY REALLLLY SUCKS especially when all numbers are ok !

This bug is a huge bug and confirmed with multiple installs. This really should be taken care of since it is a bug involving the core feature of CS Cart, selling items online!

The Air Jordan 22 -White/Varsity Red/Black were released on June 2, 2007. Air Jordan 22 features a picture of Michael Jordan with his arms extended in the air after a win. Air Jordan 22 also features a half white/ half red upper, white a clear outsole. The Air Jordan 22 was inspired by the F-22 Raptor Strike Fighter. When you look at the F-22 Raptor you see the sharp aerodynamic cuts that can cut through the air like ice. Some of these characteristics of the F-22 can be seen on the Air Jordan 22. They grey contrast stitching is a nice touch, and feature a zig zag design, which goes back to the fighter jet, which moves the same way through the air, allowing it to remain unseen on enemy radars. They also consist of a improved, color coded I.P.S. system which allows the wearer to choose his cushioning for each pod with either a responsive, double stacked Zoom Air pod, or a shock absorbing encapsulated air. Not only are these a very nice colorway, but the concept of the illustration on the side panel has never been seen on any pair of Air Jordans.