共计 349 个字符,预计需要花费 1 分钟才能阅读完成。
[php]//get a model to use
$product = Mage::getModel(‘catalog/product’);
//load it up
$parent = $product->load();
//get the collection
$children = Mage::getModel(‘catalog/product_type_configurable’)
->getUsedProductCollection($parent);
//iterate & enjoy
foreach($children as $child){
$child = $product->load($child->getId());
var_dump($child->getName());
}[/php]
正文完