B-219 Sec-55 Noida, India
+918010221733

Get Simple Products of a Configurable Product

<?php
if($_product->getTypeId() == "configurable") {
$ids = $_product->getTypeInstance()->getUsedProductIds();
?>
<ul>
<?php
foreach ($ids as $id) {
$simpleproduct = Mage::getModel('catalog/product')
->load($id);
?>
<li>
<?php
echo $simpleproduct->getName() . " - " .
(int)Mage::getModel('cataloginventory/stock_item')
->
loadByProduct($simpleproduct)->getQty();
?>
</li>
<?php
}
?>
</ul>
<?php
}
?>
(Visited 26 times, 1 visits today)

Leave a reply