Kriuchko
1/9/2019 - 8:24 AM

Getting a simple products belonging to configurable product

Magento 1 getting a simple products belonging to configurable product

if($_product->getTypeId() == "configurable"):
  $conf = Mage::getModel('catalog/product_type_configurable')->setProduct($_product);
  $simple_collection = $conf->getUsedProductCollection()->addAttributeToSelect('*')->addFilterByRequiredOptions();
  foreach($simple_collection as $simple_product){
      echo $simple_product->getSku() . " - " . $simple_product->getName() . " - " . Mage::helper('core')->currency($simple_product->getPrice()) . "<br>";
  }
endif;