Created
April 11, 2017 14:04
-
-
Save krillo/9f9b5a1bb3e0ed998fcfb058740a485c to your computer and use it in GitHub Desktop.
Loop through configurable prods children and get a custom attribute articlegroup
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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