2

喜欢 Incho 的这段代码:http://incho.net/ecommerce/magento/magento-get-bundled-items-by-bundle-product/

$bundled_product = new Mage_Catalog_Model_Product();
$bundled_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;
}

如何通过特定属性或属性集仅获取特定选项

4

0 回答 0