Get product image in Magento

Magento basically have 3 different types of product image which are as followed.
Base Image
Small Image
Thumbnail image

Now let’s see how we can get product images using product id.

$products = Mage::getModel('catalog/product')->load(900);
echo $products->getImage();
echo $products->getSmallImage();
echo $products->getThumbnail();
echo Mage::helper('catalog/image')->init($products, 'small_image')->resize(163,100);
echo Mage::helper('catalog/image')->init($products, 'image')->resize(400,400);

Tags: Magento1,

Related Posts

No comments

Leave a Reply

Your email address will not be published. Required fields are marked *