1
votes

I am using magento version 1.7.

I want show the all the bundled products in view.phtml file.

I get list of produts within bundle products using below link.

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

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

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

how can i show all bundled products

1

1 Answers

5
votes

You can filter the product collection by type:

$products = Mage::getModel('catalog/product')->getCollection()
    ->addAttributeToSelect('*')
    ->addAttributeToSelect('type')
    //->addAttributeToFilter('type_id', 'bundle') // simpler..
    ->addFieldToFilter('type_id', array('eq' => 'bundle')) // simple/configurable etc
;