Nobody that can help me? (update 17-02)
Basicly what I need it the following.
- Get the qty of stock of a product
- Show qty number X
- When negative number show 0
- When it's > 0 show image X
- When it's < 0 show image Y
Old info
In magento I am showing the stock qty with the actual numbers. When the number is lower then 0 he always shows 0. What I now want to do is add an image to both conditions.
For example when the qty is > 0 show a green image and when the qty = 0 then show a red image. Anybody knows how to do this?
<div class="qty-amount2">
<?php //echo (int) Mage::getModel('cataloginventory/stock_item')->loadByProduct($_product)->getQty(); ?>
<?php $_op_voorraad = (int) Mage::getModel('cataloginventory/stock_item')->loadByProduct($_product)->getQty();
if($_op_voorraad < 0){
$_op_voorraad = 0;
}
echo $_op_voorraad; ?><span><?php echo $this->__(' op voorraad') ?></span>