Posted By


nico65 on 08/20/09

Tagged


Statistics


Viewed 817 times
Favorited by 0 user(s)

Magento main product image switcher


/ Published in: PHP
Save to your folder(s)

--


Copy this code and paste it in your HTML
  1. replace:
  2.  
  3. <a href="#" onclick="popWin('<?php echo $this->getGalleryUrl($_image) ?>', 'gallery', 'scrollbars=yes,width=300,height=300,resizable=yes');return false;">
  4. <img src="<?php echo $this->helper('catalog/image')->init($this->getProduct(), 'thumbnail', $_image->getFile())->resize(70, 70); ?>" alt="<?php echo $this->htmlEscape($_image->getLabel()) ?>" title="<?php echo $this->htmlEscape($_image->getLabel()) ?>"/>
  5. </a>
  6.  
  7. with:
  8.  
  9. <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;">
  10. <!-- The below should remain the same as before -->
  11. <img src="<?php echo $this->helper('catalog/image')->init($this->getProduct(), 'thumbnail', $_image->getFile())->resize(70, 70); ?>" alt="<?php echo $this->htmlEscape($_image->getLabel()) ?>" title="<?php echo $this->htmlEscape($_image->getLabel()) ?>"/>
  12. </a>

URL: http://www.magentocommerce.com/boards/viewthread/6402/P0/

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.