需要显示价格最高的项目在Magento分组产品


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

我已经通读了分级定价,但这不是我想要的。目前,Magento在一个组中显示价格最低的商品,但我们的产品在一个组中可以从3,000美元到5.00美元不等。我想切换它,以便显示组中价格最高的项目而不是价格最低的项目。非常感谢任何帮助。

谢谢

试试这个:

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

你可以试试这样

$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);