Reputation: 335
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
Upvotes: 1
Views: 4851
Reputation: 12809
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
;
Upvotes: 5