0

I want to get all product images in modal for slider. So that if product view modal is opened, the it should contain all images to swipe.(on product view page)

<?php $items = $this->getItems();?>
<?php $thumbnails = $this->getGalleryImages();?>


<div class="container slick-modal-block">
    <ol class="related-product-list shop-related-slick">
        <?php foreach ($items as $item): ?>
            <li class="related-product-list_item media">
                <div class="pdp-grid">
                    <div class="col-1">
                        <div class="pdp-media">
                            <?php if (count($thumbnails) > 0): ?>
                                <?php
                                // GravDept:
                                $photoswipeIndex = 0;
                                ?>
                                <ul class="thumbnail-list">
                                <?php foreach ($thumbnails as $thumbnail): ?>
                                    <li class="thumbnail-list_item">
                                        <a
                                        class="product-image thumbnail-list_link"
                                        href="<?php echo $this->helper('catalog/image')->init($item, 'image', $thumbnail->getFile()); ?>"
                                        title="<?php echo Mage::helper('core')->quoteEscape($thumbnail->getLabel()); ?>"data-photoswipe-index="<?php echo $photoswipeIndex; ?>">
                                            <img src="<?php echo $this->helper('catalog/image')->init($this->getProduct(), 'thumbnail', $thumbnail->getFile())->resize(60); ?>" alt="<?php echo $this->escapeHtml($thumbnail->getLabel()); ?>">
                                        </a>
                                    </li>
                                    <?php $photoswipeIndex++; ?>
                                <?php endforeach; ?>
                            </ul>
                            <?php endif; ?>
                        </div>
                    </div>
2
  • Do you want to add product thumbnails to cart page? Jul 29, 2017 at 8:48
  • No, i want to get all produt images in modal for slider. So that if product view modal is opened, the it should contain all images to swipe.(on product view page) Jul 29, 2017 at 8:55

1 Answer 1

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

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