Magento2 : Product price coming same for all products
-
18-12-2020 - |
Question
I have created custom block for home page products which is extend from
Magento\Catalog\Block\Product\ListProduct
block.
After that I have called $block->getProductPrice($_product);
but it return same price (which is my first product price) for all products.
Solution
I found solution use
$_product = $objectManager->create('Magento\Catalog\Model\Product')->load($_item->getProductId());
instead
$_product = $objectManager->get('Magento\Catalog\Model\Product')->load($_item->getProductId());
Licensed under: CC-BY-SA with attribution
Not affiliated with magento.stackexchange