Author Topic: Image change on mouseover product (joomla3.9.x + virturemart3.8.x)  (Read 1130 times)

teedesign

  • Beginner
  • *
  • Posts: 1
  • My website http://badmintontshirt.com/en/
    • Badminton T-Shirts
  • Skype Name: teeyai
Image change on mouseover product (joomla3.9.x + virturemart3.8.x)

1.go to components\com_virtuemart\views\category\view.html.php   

find
Code: [Select]
$imgAmount = VmConfig::get('prodimg_browse',1);Place
Code: [Select]
$imgAmount = VmConfig::get('prodimg_browse',2);


2. after go to templates\your_template\html\com_virtuemart\sublayouts\products.php
find
Code: [Select]
<?php echo $product->images[1]->displayMediaThumb('class="browseProductImage"'false); ?>
Place
Code: [Select]
<?php if(isset($product->images[0]) && isset($product->images[1])){ ?>

<img src="<?php echo $product->images[0]->file_url?>" onmouseover="this.src='<?php echo $product->images[1]->file_url?>'" onmouseout="this.src='<?php echo $product->images[0]->file_url?>'">
<?php }elseif(isset($product->images[0]) && !isset($product->images[1]))  { 
 echo $product->images[0]->displayMediaThumb('class="browseProductImage"'false);
                } 
?>

Enjoy it.



I LOVE JOOMLA.