voorraad weergave in list mode

1
Beste..

Via een ander draadje hier op het forum heb ik alles ingesteld dat ik in de view mode van een product de actuele voorraad in getal te zien krijg. Bij producten die er niet meer zijn maar al wel in backorder bestelt zijn wordt dit getal negatief en rood.

Nu wil ik dit zelfde weergeven in de list mode van de catalogus. alleen krijg ik dit niet voor elkaar.
De code zoals hier:

<?php // List mode ?>
<?php if($this->getMode()!='grid'): ?>
<?php $_iterator = 0; ?>
<ol class="products-list" id="products-list">
<?php foreach ($_productCollection as $_product): ?>
<li class="item<?php if( ++$_iterator == sizeof($_productCollection) ): ?> last<?php endif; ?>">
<?php include('view/labels.phtml') ?>
<?php // Product description ?>
<div class="product-shop">
<div class="f-fix">
<?php $_productNameStripped = $this->stripTags($_product->getName(), null, true); ?>
<h2 class="product-name"><a href="<?php echo $_product->getProductUrl() ?>" title="<?php echo $_productNameStripped; ?>"><?php echo $_helper->productAttribute($_product, $_product->getName() , 'name'); ?></a></h2>
<?php if($_product->getRatingSummary()): ?>
<?php echo $this->getReviewsSummaryHtml($_product) ?>
<?php endif; ?>
<div id="productimgover<?php echo $_product->getId()?>" style="display: none;"><img src="<?php echo $this->helper('catalog/image')->init($_product, 'small_image')->resize(64); ?>" width="64" height="64" alt="<?php echo $this->stripTags($this->getImageLabel($_product, 'small_image'), null, true) ?>" /></div>
<div id='productname<?php echo $_product->getId()?>' style='display:none'><?php echo $_helper->productAttribute($_product, $_product->getName(), 'name') ?></div>
<div class="desc std"><?php echo $_helper->productAttribute($_product, $_product->getShortDescription(), 'short_description') ?>
<a href="<?php echo $_product->getProductUrl() ?>" title="<?php echo $_productNameStripped ?>" class="link-learn"><?php echo $this->__('Learn More') ?></a></div>
</div>
<div style="clear: both;"></div>
</div>
<div class="addtocont"><?php echo $this->getPriceHtml($_product, true) ?>

<?php if ($_product->isAvailable()): ?>
<p class="availability in-stock"><?php echo $this->__('Voorraad: ') ?> <!--<?php echo $this->__('In stock') ?>--><?= (int) Mage::getModel('cataloginventory/stock_item')->loadByProduct($_product)->getQty()?> <?php echo $this->__(' stuks') ?>
<?php if($_product->isSaleable()): ?>
<?php if ( !($_product->getTypeInstance(true)->hasRequiredOptions($_product) || $_product->isGrouped()) ) { ?>
</p>
<p>
<button type="button" title="<?php echo $this->__('Add to Cart') ?>" class="button btn-cart" onclick="setLocationAjax('<?php echo $this->getAddToCartUrl($_product) ?>','<?php echo $_product->getId()?>')"><span><span><?php echo $this->__('Add to Cart') ?></span></span></button>
</p>
<?php } else { ?>
<button type="button" title="<?php echo $this->__('Add to Cart') ?>" class="button btn-cart" onclick="showOptions('<?php echo $_product->getId()?>')"><span><span><?php echo $this->__('Add to Cart') ?></span></span></button>
<a href='<?php echo $this->getUrl('ajax/index/options',array('product_id'=>$_product->getId()));?>' class='fancybox' id='fancybox<?php echo $_product->getId()?>2' style="display: none;" ><?php echo $this->__('Add to Cart') ?></a>
<?php } ?>
<?php endif; ?>
<?php else: ?>
<p class="availability out-of-stock"><span><?php echo $this->__('Out of stock') ?><p>&nbsp;</p></span></p>
<?php endif; ?>
<?php echo $this->getChildHtml('product_type_data_extra') ?></div>
</li>
<?php endforeach; ?>
</ol>
<script type="text/javascript">decorateList('products-list', 'none-recursive')</script>

<?php else: ?>

Is de code zoals deze nu staat voor de list mode.


De code zoals hier:

<?php /* @var $this Mage_Catalog_Block_Product_View_Abstract */?>
<?php $_product = $this->getProduct() ?>

<?php $stocklevel = (int)Mage::getModel('cataloginventory/stock_item')->loadByProduct($_product)->getQty() ?>
<?php $advanceorders = $_product->getPreOrders() ?>

<!-- DISPLAYING AVAILABILITY IN STOCK -->
<?php if($_product->isSaleable() && ($stocklevel>0)): ?>
<p><?php echo $this->__('Voorraad: ') ?><?= (int) Mage::getModel('cataloginventory/stock_item')->loadByProduct($_product)->getQty()?><?php echo $this->__(' </span>') ?></p>

<!-- DISPLAYING AVAILABILITY OUT OF STOCK & NUMBER OF ITEMS IN STOCK WHERE QTY<0 -->
<?php else: ?>
<p class="availability out-of-stock"><span><strong><?php echo $this->__('Voorraad: ') ?><?= (int) Mage::getModel('cataloginventory/stock_item')->loadByProduct($_product)->getQty()?><?php echo $this->__(' </span>') ?></span></strong></p>
<?php endif; ?>

Is de code welke nu voor de view mode staat.

Ik ben al een hele dag aan het proberen maar krijg het niet voor elkaar.
Wie kan me hierin helpen?

MVG
Laurent Twint