GetProductPriceHtml Magento 2
public function getProductPriceHtml(\Magento\Catalog\Model\Product $product)
{
$priceRender = $this->getLayout()->getBlock('product.price.render.default');
if (!$priceRender) {
$priceRender = $this->getLayout()->createBlock(
\Magento\Framework\Pricing\Render::class,
'product.price.render.default',
['data' => ['price_render_handle' => 'catalog_product_prices']]
);
}
$price = '';
if ($priceRender) {
$price = $priceRender->render(
\Magento\Catalog\Pricing\Price\FinalPrice::PRICE_CODE,
$product,
[
'display_minimal_price' => true,
'use_link_for_as_low_as' => true,
'zone' => \Magento\Framework\Pricing\Render::ZONE_ITEM_LIST
]
);
}
return $price;
}
Nemo