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

Popular posts from this blog

jquery - How can I dynamically add a browser tab? -

node.js - Getting the socket id,user id pair of a logged in user(s) -

keyboard - C++ GetAsyncKeyState alternative -