magento -- 获得可配置产品的所有子产品

 

 

/*** * * @see Mage_Catalog_Model_Product_Type_Configurable::getUsedProductCollection() * **/ //get a model to use $product = Mage::getModel('catalog/product'); //load it up $parent = $product->load(/* Parent Id Here */); //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()); }  

你可能感兴趣的:(UP,产品,Magento)