Answers for "magento 2 get product image ids"

2

magento 2 get product image

//todo get product object $product 

$objectManager =\Magento\Framework\App\ObjectManager::getInstance();
$helperImport = $objectManager->get('\Magento\Catalog\Helper\Image');

$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
0

magento load product by id

$productId = 20;
$product = Mage::getModel('catalog/product')->load($productId);
Posted by: Guest on May-19-2020

Code answers related to "magento 2 get product image ids"

Code answers related to "Objective-C"

Browse Popular Code Answers by Language