Guest User

Untitled

a guest
Feb 22nd, 2018
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.89 KB | None | 0 0
  1. <?php $_images = Mage::getModel('catalog/product')->load($_product->getId())->getMediaGalleryImages(); ?>
  2. <?php if($_images){?>
  3. <?php $getimagegalleryresize=0; foreach($_images as $_image){ $getimagegalleryresize++; if($getimagegalleryresize>=2 && $getimagegalleryresize<=5): ?>
  4.  
  5. <a class="link" href="<?php echo $_product->getProductUrl(); ?>"> <img src="<?php echo $this->helper('catalog/image')->init($_product, 'small_image', $_image->getFile())->constrainOnly(TRUE)->keepAspectRatio(TRUE)->keepFrame(FALSE)->adaptiveResize(275,394); ?>" data-src="<?php echo $this->helper('catalog/image')->init($_product, 'small_image', $_image->getFile())->constrainOnly(TRUE)->keepAspectRatio(TRUE)->keepFrame(FALSE)->adaptiveResize(275,394); ?>" alt="<?php echo $this->htmlEscape($_image->getLabel());?>" title="<?php $this->htmlEscape($_image->getLabel());?>" /><?php endif; } ?> </a>
  6. <?php } ?>
Add Comment
Please, Sign In to add comment