Answers for "get image url of product magento 2 in phtml"

2

magento 2 get product image

//todo get product object $product 

$objectManager =MagentoFrameworkAppObjectManager::getInstance();
$helperImport = $objectManager->get('MagentoCatalogHelperImage');

$imageUrl = $helperImport->init($product, 'product_page_image_small')
                ->setImageFile($product->getSmallImage()) // image,small_image,thumbnail
                ->resize(380)
                ->getUrl();
echo $imageUrl;
Posted by: Guest on November-06-2020

Code answers related to "get image url of product magento 2 in phtml"

Code answers related to "Objective-C"

Browse Popular Code Answers by Language