0

How to get all image of a single product in magento and also click on download button to its download

http://foo.com

1

Get all images of single product:

<?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; ?>

For Image download, you can add "download" attribute in anchor tag. for example:

<a href="/images/myw3schoolsimage.jpg" download>
  <img border="0" src="/images/myw3schoolsimage.jpg" alt="W3Schools" width="104" height="142">
</a>

The image will download on click.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.