-
$_parentIdArray = Mage::getModel(‘catalog/product_type_configurable’)->getParentIdsByChild($_product->getId()); if(sizeof($_parentIdArray)==1 && Mage::getModel(‘catalog/product’)->load($_parentIdArray[0])->getTypeId() == ‘configurable’){ $_product = Mage::getModel(‘catalog/product’)->load($_parentIdArray[0]); }
-
$_childIdArray = Mage::getModel(‘catalog/product_type_configurable’)->getChildIds($_product->getId()); if(sizeof($_childIdArray)==1 && Mage::getModel(‘catalog/product’)->load($_childIdArray[0])->getTypeId() == ‘configurable’){ $_product = Mage::getModel(‘catalog/product’)->load($_childIdArray[0]); }
-
$_parentIdArray = Mage::getModel(‘catalog/product’)->getIdsByChild($_product->getId()); if(sizeof($_parentIdArray) >= 1 && Mage::getModel(‘catalog/product’)->load($_parentIdArray[0])->getTypeId() == ‘configurable’){ $_product = Mage::getModel(‘catalog/product’)->load($_parentIdArray[0]); }
-
$_childIdArray = Mage::getModel(‘catalog/product’)->getChildIdsByParent($_product->getId()); if(sizeof($_childIdArray)==1 && Mage::getModel(‘catalog/product’)->load($_childIdArray[0])->getTypeId() == ‘configurable’){ $_product = Mage::getModel(‘catalog/product’)->load($_childIdArray[0]); }