Magento: How to get all images in product view

Following code should help you to get all images of the product.

<?$_images = Mage::getModel('catalog/product')->load($_product->getId())->getMediaGalleryImages();?>
<?if($_images){?>
   <?$i=0; foreach($_images as $_image){ $i++;?>
      <a href="#"><img src="<?=$this->helper('catalog/image')->init($_product, 'thumbnail', $_image->getFile())->resize(200, 130); ?>" width="200" height="130" alt="<?=$this->htmlEscape($_image->getLabel());?>" title="<?=$this->htmlEscape($_image->getLabel());?>" /></a>
   <?}?>
<?}?>
Share this nice post:

15 thoughts on “Magento: How to get all images in product view

  1. The next time I learn a weblog, I hope that it doesnt disappoint me as much as this one. I imply, I know it was my option to learn, but I truly thought youd have something attention-grabbing to say. All I hear is a bunch of whining about something that you might fix if you happen to werent too busy searching for attention.

  2. Whats up! I simply would like to give an enormous thumbs up for the good info you may have here on this post. I will be coming back to your weblog for extra soon.

  3. I much like the useful data you provide inside of your content pieces.I will bookmark your web log and check again right here usually.I’m really guaranteed I will be taught a whole lot of latest stuff perfect here! Superior luck to the next!

  4. You made here great document i have to mention. Nicely written facts in this field, I appreciate to go through this type of writings. The condition of content is first-rate as well as the conclusion is very useful.

  5. Visiting this site in fact made me to find out something todays morning. Thanks a lot for sharing this info.

Comments are closed.