How to get parent product id in magento?

后端 未结 5 1793
旧巷少年郎
旧巷少年郎 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:48

    You could check the type of the product with $_product->getTypeId(); and if this returns 'configurable', take the configurable model and if it returns 'grouped' take the grouped model.

    Hope this helps.

提交回复
热议问题