1

私はmagentoバージョン1.7を使用しています。

バンドルされているすべての製品を view.phtml ファイルに表示したい。

以下のリンクを使用して、バンドル製品内の製品のリストを取得します。

Magento - 製品 ID からバンドルされた製品 ID のリストを取得する

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

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

バンドルされたすべての製品を表示する方法

4

1 に答える 1

5

製品コレクションをタイプ別にフィルタリングできます。

$products = Mage::getModel('catalog/product')->getCollection()
    ->addAttributeToSelect('*')
    ->addAttributeToSelect('type')
    //->addAttributeToFilter('type_id', 'bundle') // simpler..
    ->addFieldToFilter('type_id', array('eq' => 'bundle')) // simple/configurable etc
;
于 2013-05-23T14:32:29.443 に答える