0

我想在magento中显示Bundle产品的所有子产品。现在到处都只显示一个子产品。

提前致谢

4

1 回答 1

4
$bundled_product=Mage::getModel('catalog/product')->load(YOUR_BUNDLED_PRODUCT_ID);
$selectionCollection = $bundled_product->getTypeInstance(true)->getSelectionsCollection(
    $bundled_product->getTypeInstance(true)->getOptionsIds($bundled_product), $bundled_product
);
$bundled_items = array();
foreach($selectionCollection as $option)
{
    $bundled_items[] = $option->product_id;
}
print_r($bundled_items);
于 2013-05-24T07:47:39.177 回答