I try to display all image in product page like this
I have a loop like this:
<?php
foreach ($_product->getData('media_gallery')['images'] as $image)
{
echo '<img src="' . $image['file'] . '" />';
}
?>
The link isn't the right path and I don't know how to find the right one.
Does anyone have an idea ?
Thanks.
try below code
$product = Mage::getModel('catalog/product')->load(5);//product id here
foreach ($product->getMediaGalleryImages() as $image) {
echo $image->getUrl();
}
or
<?php foreach ($product->getMediaGalleryImages() as $image) :?>
<img src="<?php echo Mage::helper('catalog/image')->init($product, 'image', $image->getFile())->resize(100, 100); ?>" alt="<?php echo $product->getName()?>" />
<?php endforeach; ?>