Magento - get a list of bundled product ids from a product id

后端 未结 2 1735
一生所求
一生所求 2020-12-29 14:26

Lets say I load my product object:

$product = Mage::getModel(\'catalog/product\')->load($productId);

Is there a function or some way to

2条回答
  •  春和景丽
    2020-12-29 14:31

    The following should work:

    $product->getTypeInstance(true)->getChildrenIds($product->getId(), false)
    

    The result is a multi-dimensional array with the top level being options and the children of options being products.

    Also, you can change the false to a true and it will only return required options of the bundle.

提交回复
热议问题