Solution for : Getting product Image url in Magento 2.
We can get using below simple lines:
$imagehelper = $objectManager->create('Magento\Catalog\Helper\Image');
$image = $imagehelper->init($_product,'category_page_list')->constrainOnly(FALSE)->keepAspectRatio(TRUE)->keepFrame(FALSE)->resize(400)->getUrl();
echo '
';
No comments:
Post a Comment