VirtueMart Forum

VirtueMart 2 + 3 + 4 => Virtuemart Development and bug reports => Topic started by: Otto0815 on February 01, 2013, 14:55:52 PM

Title: VM2.0.18a: Stock level on category page is wrong...(bug?)
Post by: Otto0815 on February 01, 2013, 14:55:52 PM
I don't know if it works like intended, but on the category page the stocklevel indicator alwys stays "green", because the already reserverd products weren't substracted..

Example: i've 30 in Stock and some customers already have ordered all the 30, so normally the stocklevel indicator has to be "red" because there are no more products available.

But in vm2.0.18a the indicator stays green, because in /models/product.php (line 1976) the stocklevel is calculatet this way:

$stock_level = $product->product_in_stock;

I think it should be:

$stock_level = ($product->product_in_stock - $product->product_ordered)

Am i wrong?
Title: Re: VM2.0.18a: Stock level on category page is wrong...(bug?)
Post by: Milbo on February 03, 2013, 19:09:47 PM
No, you are right,

thanks, is added, will be in the 2.0.18b