user3703475
user3703475

Reputation: 15

Need to display the highest priced item in Magento Grouped Product.

I have read through the tier pricing but that is not what I am looking for. Currently Magento displays the lowest priced item in a group but our products in one group can range from $3,000 to $5.00. I would like to switch it so that the highest priced item in the group displays as opposed to the lowest price. Any help is greatly appreciated.

Thanks

Upvotes: 0

Views: 1210

Answers (2)

Shawn Abramson
Shawn Abramson

Reputation: 701

Try this:

$groupedPrice = Mage::getModel('catalog/product_grouped_price'); 
echo $groupedPrice->getMaxPrice($_product->getId());

This is if you use grouped products on your site.

Upvotes: 1

zaka47
zaka47

Reputation: 83

You can try something like this

$selectionCollection = $product->getTypeInstance ( true )->getSelectionsCollection ( $product->getTypeInstance ( true )->getOptionsIds ( $product ), $product );
$grouped_items = array ();
foreach ( $selectionCollection as $option ) {
    $grouped_items [] = $item;
}
foreach ( $grouped_items as $item) {
        $arrayPrice [] = $item->getPrice;
}
maxPrice = max($arrayPrice);

Upvotes: 0

Related Questions