Magentoは、単純な製品から所属する構成可能な製品を取得します.

499 ワード


$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]);
}
}