i would like to change logic visibility:status i want logic work like this
if any simple(child)product has qty > 0
Show product status in stock else show out of stock.
My code is
app/design/frontend/default/mythem/template/catalog/product/view/type/default.phtml
<?php $_product = $this->getProduct() ?>
<div class="available_price">
<?php if ($this->displayProductStockStatus()): ?>
<?php if((int) Mage::getModel('cataloginventory/stock_item')->loadByProduct($_product)->getQty() > 0): ?>
<p class="availability in-stock"><?php echo $this->__('Availability:') ?> <span><?php echo $this->__('In stock') ?></span></p>
<?php else: ?>
<p class="availability out-of-stock"><?php echo $this->__('Availability:') ?> <span><?php echo $this->__('Out of stock') ?></span></p>
<?php endif; ?>
<?php endif; ?>
it logic working but issue is if configurable product has qty > 0
show out of stock.
i want this logic just work for simple(child products)