I have this code:
<?php if($_product->isSaleable()): ?>
<p><?php echo $this->__('In stock:') ?>
<?=(int)Mage::getModel('cataloginventory/stock_item')->loadByProduct($_product)->getQty() ?>
<?php echo $this->__(' stk.') ?></p>
<?php endif; ?>
It works great for simple products, shows how many left.
But i also use configurable products. How can I get the code to get the stock of the simple product when the parent is a configurable? Now it shows 0.