Posting in the Magento forums has been disabled pending the implementation of a new and improved forum solution which should better serve the community.

For new questions please post at magento.stackexchange.com, the community-run support site for the Magento community. We will be providing updates on the new forum solution soon. For questions or concerns please email community@magento.com.

Magento Forum

Swap Image Of Product On Hover Or on Click Tump
 
dankocrama980
Jr. Member
 
Total Posts:  16
Joined:  2011-10-05
 

Hello,

i am trying get some code working when a user hovers on the product tumps ( media gallery )
its swaps the base image but cant get it to work hope some one can help me smile

so when on hover on tump in gallery Images its swaps the src of the image product image box

here is my code

<!-- start product image box   -->

        <
div class="product-img-box">
            
<?php
                    $_img 
'<img src="'.$this->helper('catalog/image')->init($_product'image')->resize(400600).'" alt="'.$this->htmlEscape($this->getImageLabel()).'" title="'.$this->htmlEscape($this->getImageLabel()).'" />';
                    echo 
$_helper->productAttribute($_product$_img'image');
                
?>        </div>



                <!-- 
end  product image box   -->

                <!-- 
Bring in gallery Images    -->
                
                                    
<?php $_gallery Mage::getModel('catalog/product')->load($_product->getId())->getMediaGalleryImages();  ?>
                                    <?php $imgcount 
Mage::getModel('catalog/product')->load($_product->getId())->getMediaGalleryImages()->count();?>
                                    <?php 
if($imgcount >0): ?>
                                        
<div class="more-views" style="float:left; padding-left:5px; padding-top:0px;">                   
                                           
                                            
<?php foreach ($_gallery as $_image ):  ?>
                                                
<li>
                    
                                                    <
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;">
                                                    <
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()) ?>"/>
                                                    </
a>
                    
                                                
                                                </
li>
                                             
<?php endforeach;  ?>
                                            
                                        
</div>
                                    
<?php endif; ?>

            
<!-- end  Bring in gallery Images    -->

hope someone can help me out

Greetings

 
Magento Community Magento Community
Magento Community
Magento Community
 
paulocastro
Jr. Member
 
Avatar
Total Posts:  1
Joined:  2012-12-04
 

I am having the same problem. Did U have any sucess? Regards.

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top