Skip to content

Instantly share code, notes, and snippets.

@amacgregor
Created August 9, 2011 15:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save amacgregor/1134428 to your computer and use it in GitHub Desktop.
Save amacgregor/1134428 to your computer and use it in GitHub Desktop.
Load Simple products by configurable parent id
<?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