Magento – display more than one image on page list

If you need to pull out more than one image per product in page list (list.phtml), the code below will help you.

<?php
  //get more images for product
  $product = Mage::getModel('catalog/product')->load($_product->getId());
  foreach ($product->getMediaGalleryImages() as $image) {
     echo "<img src='" . $this->helper('catalog/image')->init($this->getProduct(), 'thumbnail', $image->getFile())->resize(50) . "' />";
  }
?>

Leave a Reply