How do I display product images in CMS pages in Magento? by KulfiSoftware
How do I display product images in CMS pages in Magento? There are two ways to display product image:
Magento is an ecommerce platform built on open source technology which provides online merchants with a flexible shopping cart system, as well as control over the look, content and functionality of their online store. Magento offers powerful marketing, search engine optimization, and catalog-management tools.
1. You can upload by hand
- In Admin Panel, selecting CMS page you want to use as well as you can create a new one.
- The left menu side, click tab Content
- In Content, click Show/Hide Editor to hide editor and display insert buttons.
- Click to Insert Image to turn on image management tools.
2. You can set up code to upload automatically
For instance, you insert this code in a file named “productimage.phtml” in the folder named “catalog/product”.
– In the CMS page you will type this code: {{block type=”catalog/product_list” template=”catalog/product/productimage.phtml”}}
As well as you can use this, {{block type=”catalog/product_view” template=”catalog/product/productimage.phtml”}}
But, here comes the next step is this code
echo Mage::getModel(‘catalog/product_media_config’)->getMediaUrl( $_product->getThumbnail() );
//also try getImage(),getSmallImage(), getThumbnail()
If this code doesn’t work try another one
$_pr = Mage::getModel(‘catalog/product’)->load($_item->getId());
// now get the image
echo Mage::getModel(‘catalog/product_media_config’)->getMediaUrl( $_pr->getThumbnail() );
MAY