In the meantime I tried to compare the controller and view of the category with the controller and category of the cart because in the category the on hand stock is shown correclty.
In the category controller (catalog/ctonroller/caegory.php) is this code:
Code: Select all
'stock_level' => $result['quantity'],
and when you access this in the view of the category with:
Code: Select all
<?php echo $product['stock_level']; ?>
It shows the stock level of the item correctly.
In the cart controller ( (catalog/ctonroller/cart.php) we have:
Code: Select all
'quantity' => $result['quantity'],
...
'stock' => $result['stock'],
When you access these values in the cart view:
Code: Select all
<?php echo $product['quantity']; ?>
shows the selected quantity and not the in stock quantitiy.
outputs nothing because it is bool, giving true, when the selected quantity is less the in stock and false if not.
I can not figure it out.