Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save krillo/9f9b5a1bb3e0ed998fcfb058740a485c to your computer and use it in GitHub Desktop.
Save krillo/9f9b5a1bb3e0ed998fcfb058740a485c to your computer and use it in GitHub Desktop.
Loop through configurable prods children and get a custom attribute articlegroup
<?php
//loop through configurable prods children and get a custom attribute articlegroup
$_product = $this->getProduct();
$productType = $_product->getTypeID();
$articleGroup = '';
if ($productType == 'configurable') {
$childProducts = Mage::getModel('catalog/product_type_configurable')->getChildrenIds($_product->getID());
foreach ($childProducts[0] as $childId => $value) {
$child = Mage::getModel('catalog/product')->load($childId);
$articleGroup = $child->getArticlegroup();
}
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment