Skip to content

Instantly share code, notes, and snippets.

@WENKz
Created July 21, 2015 07:58
Show Gist options
  • Save WENKz/4ce1627a223636bf8fa7 to your computer and use it in GitHub Desktop.
Save WENKz/4ce1627a223636bf8fa7 to your computer and use it in GitHub Desktop.
Magento: Get a configurable products associated simple product data
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;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment