Find parent id of product in magento -
here code.
$storeid = mage::app()->getstore()->getid(); $session = mage::getsingleton('checkout/session'); foreach($session->getquote()->getallitems() $item) {//how find parent id here}
at above mentioned comment want access parent id of particular product. please ..
try below code, may you
if($item->gettypeid() == "simple"){ $parentids = mage::getmodel('catalog/product_type_grouped')->getparentidsbychild($item->getid()); // check grouped product if(!$parentids) $parentids = mage::getmodel('catalog/product_type_configurable')->getparentidsbychild($item->getid()); //check config product }
Comments
Post a Comment