Our customer would like to display lowest possible price in product list pages. All visible products in website are bundle products
This is the function which displays the price
Magento\Catalog\Block\Product\ListProduct
public function getProductPrice(\Magento\Catalog\Model\Product $product)
{
$priceRender = $this->getPriceRender();
$price = '';
if ($priceRender) {
$price = $priceRender->render(
\Magento\Catalog\Pricing\Price\FinalPrice::PRICE_CODE,
$product,
[
'include_container' => true,
'display_minimal_price' => true,
'zone' => \Magento\Framework\Pricing\Render::ZONE_ITEM_LIST,
'list_category_page' => true
]
);
}
return $price;
}
The fast try (changing \Magento\Catalog\Pricing\Price\FinalPrice::PRICE_CODE to \Magento\Catalog\Pricing\Price\TierPrice::PRICE_CODE) obviously doesn't work, as TierPrice should return an array or some complex data and not a price amount
How to achieve this? Any tips?
update
Missed to comment that products in catalog are bundle