I am quite new to Magento. As far as I understand, I need to form configurable products, to manage different size of a product. I want to show stock qty of each size seperately in the product view page. Is this possible? My attribute name is 'size'. I have used the following code to get stock qty. However, it is unable to get stock qty of indivual simple product of a configurable product.
<?php
$__manStock = $_product->getStockItem()->getManageStock();
$__invAmt =(int)Mage::getModel('cataloginventory/stock_item')->loadByProduct($_product)->getQty('small');
if ($__manStock > 0)
{
echo $this->__("$__invAmt");
}
?>
Best Answer
$_product
is your configurable product.To get all its simple products use :
So you might have something like :
I let you adapt to your precise needs and ask question if needed