I am trying to change the image on hover for product in listing page for one of our Magento Eshop. I can change the image on hover. What i did was i used small and thumbnail image for it and changed it using mouseenter and mouseleave event.
But now i want to change it based on sort order. Say the image with Sort Order 2 should be visible on hover.
I am not sure how to do it ? Could anyone please guide me on this. From where shall i start ?
Thanks
Best Answer
I was able to solve it. I am pasting the code below for what i did.
Step 1 : Created an helper file and have added this code in there
Please review the code. It will pretty much explain everything.
To call the alternative image use the following code :
Here 2 is the position of image and rest are the image parameters