Jump to content

in product list page, on mouse over to show the second thumbnail..


Recommended Posts

for instance, i know in product-list.tpl, this code responsible for showing the thumbnail is :
getImageLink($product.link_rewrite, $product.id_image, 'home')

now if I want the user on mouse over the thumbnail, it shows the second product image, is it possible?
It can be done by javascript I think..

however, I want to know how to I get the second image URL?
which parameters in getImageLink corresponds to the second image data?

Many thanks.

Link to comment
Share on other sites

  • 1 year later...
  • 2 weeks later...

Hello!

 

When listing the products the data structure containing the information about the products, holds only the cover image.

To display 2 images from the same product: either you edit the 'getProducts' function in 'classes/Category.php' (this would be a global change) either you write your own SQL query in 'CategoryController.php' (this change would affect only the product listing by category).

 

You also need to change the 'product_list.tpl'. You could have the 2 images placed upon each other (one in the front other in the back) and using Javascript/Jquery on the mouse over event you call the fadein/fadeout functions.

  • Like 1
Link to comment
Share on other sites

If you want it only for the featured products on home page:

1. create the new SQL query in 'modules/homefeatured/homefeatured.php'

2. modify the HTML in 'modules/homefeatured/homefeatured.tpl'

3. include the Javascript in 'modules/homefeatured/homefeatured.tpl'

 

You will also need to add new CSS styles for the two images.

  • Like 1
Link to comment
Share on other sites

  • 1 year later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...