Saturday, June 18, 2016

Magento 2 Getting product Image url

$imagehelper = $objectManager->create('Magento\Catalog\Helper\Image');
$image = $imagehelper->init($_product,'category_page_list')->constrainOnly(FALSE)->keepAspectRatio(TRUE)->keepFrame(FALSE)->resize(400)->getUrl();

<img src="<?php echo $image; ?>">

4 comments:

  1. Thanks for sharing these. It’s always useful to get pointers to the good blogs out there.
    Megento User Email Lists offered by Parana Impact will help your organization fill in the blanks in your databases.

    ReplyDelete
  2. also use it to promote your latest products and offers or inform people about what your business does. event marketing and corporate event gift ideas

    ReplyDelete