Php 需要显示Magento分组产品中价格最高的项目。
我已经通读了分层定价,但这不是我想要的。目前,Magento在一组中显示价格最低的商品,但我们在一组中的产品价格从3000美元到5.00美元不等。我想切换它,以便显示组中价格最高的项目,而不是价格最低的项目。非常感谢您的帮助Php 需要显示Magento分组产品中价格最高的项目。,php,magento,e-commerce,Php,Magento,E Commerce,我已经通读了分层定价,但这不是我想要的。目前,Magento在一组中显示价格最低的商品,但我们在一组中的产品价格从3000美元到5.00美元不等。我想切换它,以便显示组中价格最高的项目,而不是价格最低的项目。非常感谢您的帮助 谢谢你可以试试这样的东西 $selectionCollection = $product->getTypeInstance ( true )->getSelectionsCollection ( $product->getTypeInstance ( tr
谢谢你可以试试这样的东西
$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);
试试这个:
$groupedPrice = Mage::getModel('catalog/product_grouped_price');
echo $groupedPrice->getMaxPrice($_product->getId());
如果您在站点上使用分组产品,则会出现这种情况。这会被放置在分组产品的price.php文件中吗?在catalog/product/price.phtml中,靠近这一行的底部:这是我所做的部分工作。该文件太大,无法添加为注释,但它应该是实现目标所需的内容。请查看我的一个分组产品谢谢。我无法了解您的产品外观,但我能够了解它,以便在您单击分组产品之前不会显示定价,这在我们的情况下也同样有效。