Archive

Posts Tagged ‘thumbnail enlarge’

Magento Notes — Show thumbnail image without pop-up window

March 19th, 2009

Finding ways to improve on the usability of tickon.com, I have made a small improvement.  I thought it was quite annoying to always have to wait for a new window to open to view the alternate images, so did some googling and found the perfect fix on Magento forum (link to exact post).  This fix simply allows you to click on the thumbnail alternate images and have it be shown in the large image box above.  Without going through the discussion thread…here’s the quick fix:

Locate media.phtml in app/design/frontend/default/themename/template/catalog/product/view, and near line# 59, you should see:

<a href=”#” onclick=”popWin(’<?php echo $this->getGalleryUrl($_image) ?>’, ‘gallery’, ‘width=300,height=300,left=50,top=50,location=no,status=yes,scrollbars=yes,resizable=yes’); return false;”><img src=”<?php echo $this->helper(’catalog/image’)->init($this->getProduct(), ‘thumbnail’, $_image->getFile())->resize(120); ?>” alt=”<?php echo $this->htmlEscape($_image->getLabel()) ?>” title=”<?php echo $this->htmlEscape($_image->getLabel()) ?>” /></a>

change the part in red to the following:

<a href=”<?php echo $this->helper(’catalog/image’)->init($this->getProduct(), ‘image’, $_image->getFile()); ?>” title=”<?php echo $_product->getName();?>” onclick=”$(’image’).src = this.href; return false;”>

You should be able to modify it a bit more if you want the image to update on mouseover.

blog posting, e-commerce, magento, technical notes , ,