Created
August 9, 2011 15:54
-
-
Save amacgregor/1134428 to your computer and use it in GitHub Desktop.
Load Simple products by configurable parent id
This file contains hidden or 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 | |
//Where $parent is your configurable product object | |
$configurableProduct = Mage::getModel('catalog/product_type_configurable')->setProduct($parent); | |
$simpleCollection = $configurableProduct->getUsedProductCollection()->addAttributeToSelect('*'); | |
foreach($simpleCollection as $simple){ | |
//Do something here to modify your parent product. | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment