I tried several ideas I could find at google, but no one did work for me for few days. Finally I found a way to display in a custom extension the "minimal possible price" and the "maximal possible price" for a bundle product in magento:
$_product_id = YOUR_BUNDLE_PRODUCT_ID;
// highest possible price for this bundle product
$return_type = 'max'; // because I used this in a helper method
// lowest possible price for this bundle product
// $return_type = 'min';
$model_catalog_product = Mage::getModel('catalog/product'); // getting product model
$_product = $model_catalog_product->load( $_product_id );
$TypeInstance = $_product->getTypeInstance(true);
$Selections = $TypeInstance->getSelectionsCollection($OptionIds, $_product );
$Options = $TypeInstance->getOptionsByIds($OptionIds, $_product);
$bundleOptions = $Options->appendSelections($Selections, true);
$minmax_pricevalue = 0; // to sum them up from 0
foreach ($bundleOptions as $bundleOption) {
if ($bundleOption->getSelections()) {
$bundleSelections = $bundleOption->getSelections();
$pricevalues_array = array();
foreach ($bundleSelections as $bundleSelection) {
$pricevalues_array[] = $bundleSelection->getPrice();
}
if ( $return_type == 'max' ) {
rsort($pricevalues_array); // high to low
} else {
sort($pricevalues_array); // low to high
}
// sum up the highest possible or lowest possible price
$minmax_pricevalue += $pricevalues_array[0];
}
}
// echo $minmax_pricevalue;
echo ''.Mage::helper('core')->currency($minmax_pricevalue, true, false).'';
If you have better and shorter ways feel free to post here. Thanks to all involved!
Background of all was that, I have made a custom extension and wanted also to show there the "minimal possible price" and the "maximal possible price" for such a configuration. Magento-Setup was: Native "bundle product" several "Bundle Items Options" connected my "bundle product". Each "bundle option" has multiple simple products with different prices in it. I think that was the point here.
Hope that all helps someone - love to share such stuff :-)