12th Jul
0
Output more than one image per product on list (category page) of Magento.
For a project I needed to find a way to pull out more than one image per product in list.phtml (category page) but also pulling out a certain size , the below code allows you to load all the images for that specific product, you can then manipulate the image either adding classes to it or adding inline styles.
//get images for product $product = Mage::getModel('catalog/product')->load($_product->getId()); $helper = Mage::Helper('catalog/image'); foreach ($product->getMediaGalleryImages() as $image) { echo "<img src='" . $this->helper('catalog/image')->init($this->getProduct(), 'thumbnail', $image->getFile())->resize(243) . "' />"; } ?>