How to get parent product id in magento?

后端 未结 5 1796
旧巷少年郎
旧巷少年郎 2021-02-07 01:55

I know that in Magento 1.4.2.0 one gets parent id\'s like so

list( $parentId ) = Mage::getModel(\'catalog/product_type_configurable\')
                                   


        
5条回答
  •  粉色の甜心
    2021-02-07 02:34

    You may use:

    $product->getTypeInstance();
    

    Which will return the type object of your product

    Then you can perform your:

    ->getParentIdsByChild()
    

    Giving finally:

    $product->getTypeInstance()->getParentIdsByChild($child->getId());
    

提交回复
热议问题