Magento通过简单产品获得所属的可配置产品

$product = Mage::getModel(‘catalog/product’)
->setStoreId(Mage::app()->getStore()->getId())
->load($productId);


if($product->type_id==“simple”)

{
$parentId=$product->loadParentProductIds()->getData('parent_product_ids');
if(isset($parentId[0]))
{
//configurable product
$product=Mage::getModel('catalog/product')->load($parentId[0]);
}
} 

你可能感兴趣的:(PHP)