[Skip to main content](#vessel-content)

#   Change product image on hover in product listing

##

- **[niqui](/forum/user/2055-niqui "View niqui's Profile")**
- [![niqui's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/2055-niqui "View niqui's Profile") Topic Author
- [ Offline](/forum/user/2055-niqui)

Less More

- Posts: 70
- Thank you received: 3
-
-
- [](http://apestaart.info)
-

12 years 6 months ago -  12 years 6 months ago [\#156942](#156942) by [niqui](/forum/user/2055-niqui "View niqui's Profile")  *[Change product image on hover in product listing](/forum/26-product-category-display/868407-change-product-image-on-hover-in-product-listing#156942 "Hi,  I was wondering if there is a way to change the product image on hover. I have created a menu item that shows a product listing (div) of a specific category. My customer would like it if the main product image changes to the second product image when hovering. For an example of the desired effect take a look at   www.zoekarssenshop.com/highlited.html  Would that be very complicated to build?  Thanks for any ideas.")* was created by *[niqui](/forum/user/2055-niqui "View niqui's Profile")*

Hi,

I was wondering if there is a way to change the product image on hover. I have created a menu item that shows a product listing (div) of a specific category. My customer would like it if the main product image changes to the second product image when hovering. For an example of the desired effect take a look at [ www.zoekarssenshop.com/highlited.html](http://www.zoekarssenshop.com/highlited.html)

Would that be very complicated to build?

Thanks for any ideas.

Last edit: 12 years 6 months ago by [niqui](/forum/user/2055-niqui "View niqui's Profile").

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI2LXByb2R1Y3QtY2F0ZWdvcnktZGlzcGxheS84Njg0MDctY2hhbmdlLXByb2R1Y3QtaW1hZ2Utb24taG92ZXItaW4tcHJvZHVjdC1saXN0aW5nP3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[Xavier](/forum/user/4105-xavier "View Xavier's Profile")**
- [![Xavier's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar4105.png)](/forum/user/4105-xavier "View Xavier's Profile")
- [ Offline](/forum/user/4105-xavier)

Less More

- Posts: 13201
- Thank you received: 2322
-
-
-
- [](http://www.kidiweb.fr)
-

12 years 6 months ago [\#156950](#156950) by [Xavier](/forum/user/4105-xavier "View Xavier's Profile")  Replied by *[Xavier](/forum/user/4105-xavier "View Xavier's Profile")* on topic *[Change product image on hover in product listing](/forum/26-product-category-display/868407-change-product-image-on-hover-in-product-listing#156950 "Hi,  I was wondering if there is a way to change the product image on hover. I have created a menu item that shows a product listing (div) of a specific category. My customer would like it if the main product image changes to the second product image when hovering. For an example of the desired effect take a look at   www.zoekarssenshop.com/highlited.html  Would that be very complicated to build?  Thanks for any ideas.")*

Hi,

You will have to edit the view "product / listing_img_title" and in the image part, add a Mysql request to get the other image path. Add another img tag with the second image link and apply a display:none; css property.

Then add javascript event on the images to hide the first one and display the other one when mouse over.

So if you have development skills in PHP, Javascript it will be easy, else there is some things to learn before doing that ![;)](/media/kunena/emoticons/24.png ";)")

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI2LXByb2R1Y3QtY2F0ZWdvcnktZGlzcGxheS84Njg0MDctY2hhbmdlLXByb2R1Y3QtaW1hZ2Utb24taG92ZXItaW4tcHJvZHVjdC1saXN0aW5nP3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[niqui](/forum/user/2055-niqui "View niqui's Profile")**
- [![niqui's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/2055-niqui "View niqui's Profile") Topic Author
- [ Offline](/forum/user/2055-niqui)

Less More

- Posts: 70
- Thank you received: 3
-
-
- [](http://apestaart.info)
-

12 years 6 months ago [\#157229](#157229) by [niqui](/forum/user/2055-niqui "View niqui's Profile")  Replied by *[niqui](/forum/user/2055-niqui "View niqui's Profile")* on topic *[Change product image on hover in product listing](/forum/26-product-category-display/868407-change-product-image-on-hover-in-product-listing#157229 "Hi,  I was wondering if there is a way to change the product image on hover. I have created a menu item that shows a product listing (div) of a specific category. My customer would like it if the main product image changes to the second product image when hovering. For an example of the desired effect take a look at   www.zoekarssenshop.com/highlited.html  Would that be very complicated to build?  Thanks for any ideas.")*

OK, thanks for the answer. I was afraid it would involve some knowledge of PHP and javascript. Maybe I'll try and see how far I get, but at least I can tell my client it's not that 'just a click on a button' to achieve this ![;)](/media/kunena/emoticons/24.png ";)")

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI2LXByb2R1Y3QtY2F0ZWdvcnktZGlzcGxheS84Njg0MDctY2hhbmdlLXByb2R1Y3QtaW1hZ2Utb24taG92ZXItaW4tcHJvZHVjdC1saXN0aW5nP3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[bolando](/forum/user/38611-bolando "View bolando's Profile")**
- [![bolando's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/38611-bolando "View bolando's Profile")
- [ Offline](/forum/user/38611-bolando)

Less More

- Posts: 91
- Thank you received: 5
-
-

9 years 3 months ago [\#276047](#276047) by [bolando](/forum/user/38611-bolando "View bolando's Profile")  Replied by *[bolando](/forum/user/38611-bolando "View bolando's Profile")* on topic *[Change product image on hover in product listing](/forum/26-product-category-display/868407-change-product-image-on-hover-in-product-listing#276047 "Hi,  I was wondering if there is a way to change the product image on hover. I have created a menu item that shows a product listing (div) of a specific category. My customer would like it if the main product image changes to the second product image when hovering. For an example of the desired effect take a look at   www.zoekarssenshop.com/highlited.html  Would that be very complicated to build?  Thanks for any ideas.")*

Hey,

I also needed that function and I found a solution. It works if you have more than one image for product and shows the second one:

1) In my template override
/html/com_hikashop/product/listing_img_title.php
I added Code:

&lt;span class="obrazek2"&gt; &lt;?php echo $this-&gt;row-&gt;images[1]-&gt;file_path;?&gt; &lt;/span&gt;

in line 72

2) In CSS I added of course: Code:

.obrazek2 { display:none }

3) Than supposing you have 4 columns view and original images set as 420px x 420px (like in my case), you add a jQuery code to your template: Code:

jQuery('.hkc-md-3.hikashop_product').each(function(){ var obrazek = jQuery.trim(jQuery(this).find('.obrazek2').text()); var obrazekOk = jQuery(this).find('img').attr('src'); if (obrazek.length &gt; 15) { jQuery(this).find('img.hikashop_product_listing_image').mouseover(function(){ jQuery(this).css('width','182px').height('182px').attr('src','/new/images/com_hikashop/upload/thumbnails/420x420f/'+obrazek) }) jQuery(this).find('img.hikashop_product_listing_image').mouseout(function(){ jQuery(this).attr('src',obrazekOk) }) } })

Works fine.

The following user(s) said Thank You: [shopshop](/forum/user/47513-shopshop "View shopshop's Profile")

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI2LXByb2R1Y3QtY2F0ZWdvcnktZGlzcGxheS84Njg0MDctY2hhbmdlLXByb2R1Y3QtaW1hZ2Utb24taG92ZXItaW4tcHJvZHVjdC1saXN0aW5nP3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[Jerome](/forum/user/80-jerome "View Jerome's Profile")**
- [![Jerome's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar80.png)](/forum/user/80-jerome "View Jerome's Profile")
- [ Offline](/forum/user/80-jerome)
- HikaShop core developer

Less More

- Posts: 26402
- Thank you received: 4081
-
- [](http://obsi.dev)
-

9 years 3 months ago [\#276058](#276058) by [Jerome](/forum/user/80-jerome "View Jerome's Profile")  Replied by *[Jerome](/forum/user/80-jerome "View Jerome's Profile")* on topic *[Change product image on hover in product listing](/forum/26-product-category-display/868407-change-product-image-on-hover-in-product-listing#276058 "Hi,  I was wondering if there is a way to change the product image on hover. I have created a menu item that shows a product listing (div) of a specific category. My customer would like it if the main product image changes to the second product image when hovering. For an example of the desired effect take a look at   www.zoekarssenshop.com/highlited.html  Would that be very complicated to build?  Thanks for any ideas.")*

Hello,

Thank you for sharing.

Regarding your code, it is really specific to your website (the hard coded URL with the prefix and the thumbnail size).
I think such kind of implement could be done using CSS2/3 rules ; but for sure it would require to display the second image using the HikaShop image helper ; and not just display the file_path of that image.

Regards,

---

Jerome - Obsidev.com
HikaMarket &amp; HikaSerial developer / HikaShop core dev team.

The following user(s) said Thank You: [shopshop](/forum/user/47513-shopshop "View shopshop's Profile")

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI2LXByb2R1Y3QtY2F0ZWdvcnktZGlzcGxheS84Njg0MDctY2hhbmdlLXByb2R1Y3QtaW1hZ2Utb24taG92ZXItaW4tcHJvZHVjdC1saXN0aW5nP3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[shopshop](/forum/user/47513-shopshop "View shopshop's Profile")**
- [![shopshop's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/47513-shopshop "View shopshop's Profile")
- [ Offline](/forum/user/47513-shopshop)

Less More

- Posts: 13
- Thank you received: 0
-
-

7 years 1 month ago [\#312254](#312254) by [shopshop](/forum/user/47513-shopshop "View shopshop's Profile")  Replied by *[shopshop](/forum/user/47513-shopshop "View shopshop's Profile")* on topic *[Change product image on hover in product listing](/forum/26-product-category-display/868407-change-product-image-on-hover-in-product-listing#312254 "Hi,  I was wondering if there is a way to change the product image on hover. I have created a menu item that shows a product listing (div) of a specific category. My customer would like it if the main product image changes to the second product image when hovering. For an example of the desired effect take a look at   www.zoekarssenshop.com/highlited.html  Would that be very complicated to build?  Thanks for any ideas.")*

> Jerome wrote: Hello,
>
> Thank you for sharing.
>
> Regarding your code, it is really specific to your website (the hard coded URL with the prefix and the thumbnail size).
> I think such kind of implement could be done using CSS2/3 rules ; but for sure it would require to display the second image using the HikaShop image helper ; and not just display the file\_path of that image.
>
> Regards,

**Hi
Can I ask you for guidance on how to standardize the second image?**

*/new/images/com\_hikashop/upload/thumbnails/420x420f/*
The way it is said is not principled at all.
thnak you very much.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI2LXByb2R1Y3QtY2F0ZWdvcnktZGlzcGxheS84Njg0MDctY2hhbmdlLXByb2R1Y3QtaW1hZ2Utb24taG92ZXItaW4tcHJvZHVjdC1saXN0aW5nP3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png?1793428657)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Offline](/forum/user/63-nicolas)

Less More

- Posts: 86587
- Thank you received: 14326
-
-

7 years 1 month ago [\#312262](#312262) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Change product image on hover in product listing](/forum/26-product-category-display/868407-change-product-image-on-hover-in-product-listing#312262 "Hi,  I was wondering if there is a way to change the product image on hover. I have created a menu item that shows a product listing (div) of a specific category. My customer would like it if the main product image changes to the second product image when hovering. For an example of the desired effect take a look at   www.zoekarssenshop.com/highlited.html  Would that be very complicated to build?  Thanks for any ideas.")*

Hi,

You basically need to change the line:
jQuery(this).css('width','182px').height('182px').attr('src','/new/images/com_hikashop/upload/thumbnails/420x420f/'+obrazek)
You need to replace 182px byt the width and height of the thumbnails on your listing and change the path /new/images/com_hikashop/upload/thumbnails/420x420f/ to the path where the thumbnails are on your website.
It will probably be something like that: /images/com_hikashop/upload/thumbnails/XXXxYYY/
You need ot go in the folder /images/com_hikashop/upload/thumbnails/ via FTP and look at the available folders.
Also, this code requires jQuery to be available on the page.
It's probable that you have it, but it could be possible you don't.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI2LXByb2R1Y3QtY2F0ZWdvcnktZGlzcGxheS84Njg0MDctY2hhbmdlLXByb2R1Y3QtaW1hZ2Utb24taG92ZXItaW4tcHJvZHVjdC1saXN0aW5nP3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[Giannakopoulos](/forum/user/61915-giannakopoulos "View Giannakopoulos's Profile")**
- [![Giannakopoulos's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/61915-giannakopoulos "View Giannakopoulos's Profile")
- [ Offline](/forum/user/61915-giannakopoulos)

Less More

- Posts: 2
- Thank you received: 0
-
-

5 years 3 months ago -  5 years 3 months ago [\#334972](#334972) by [Giannakopoulos](/forum/user/61915-giannakopoulos "View Giannakopoulos's Profile")  Replied by *[Giannakopoulos](/forum/user/61915-giannakopoulos "View Giannakopoulos's Profile")* on topic *[Change product image on hover in product listing](/forum/26-product-category-display/868407-change-product-image-on-hover-in-product-listing#334972 "Hi,  I was wondering if there is a way to change the product image on hover. I have created a menu item that shows a product listing (div) of a specific category. My customer would like it if the main product image changes to the second product image when hovering. For an example of the desired effect take a look at   www.zoekarssenshop.com/highlited.html  Would that be very complicated to build?  Thanks for any ideas.")*

Hello, Does anyone know what does it take to imply this feature in the latest version of Hikashop?
Thank you all in advnce!
PS
I Tried the above solution but it doesn't work

Last edit: 5 years 3 months ago by [Jerome](/forum/user/80-jerome "View Jerome's Profile"). Reason: remove full quote of message #276047

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI2LXByb2R1Y3QtY2F0ZWdvcnktZGlzcGxheS84Njg0MDctY2hhbmdlLXByb2R1Y3QtaW1hZ2Utb24taG92ZXItaW4tcHJvZHVjdC1saXN0aW5nP3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png?1793428657)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Offline](/forum/user/63-nicolas)

Less More

- Posts: 86587
- Thank you received: 14326
-
-

5 years 3 months ago [\#335304](#335304) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Change product image on hover in product listing](/forum/26-product-category-display/868407-change-product-image-on-hover-in-product-listing#335304 "Hi,  I was wondering if there is a way to change the product image on hover. I have created a menu item that shows a product listing (div) of a specific category. My customer would like it if the main product image changes to the second product image when hovering. For an example of the desired effect take a look at   www.zoekarssenshop.com/highlited.html  Would that be very complicated to build?  Thanks for any ideas.")*

Hi,

We actually added that capability recently:
[ www.hikashop.com/home/blog/471-hikashop-4-4-3.html#multi](https://www.hikashop.com/home/blog/471-hikashop-4-4-3.html#multi)
So no need to change any code.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI2LXByb2R1Y3QtY2F0ZWdvcnktZGlzcGxheS84Njg0MDctY2hhbmdlLXByb2R1Y3QtaW1hZ2Utb24taG92ZXItaW4tcHJvZHVjdC1saXN0aW5nP3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

Board Categories HikaShop Install &amp; Update Product &amp; Category Display Content Creation Sales and Orders Orders management Reports &amp; Statistics Customers Checkout Payment Methods Shipping Methods Import &amp; Export (CSV, XLS…) Specific Features Affilation Taxes Wishlist Vote Carousel &amp; Slider Mass Actions Filters &amp; Search Discount &amp; Coupon Feature Request Integrations Showcase General Talk about HikaShop Development HikaShop 3.0 Beta Translation Commercial Jobs HikaShop Components HikaMarket Market: Feature requests Market: How to? Market: Bug Report HikaSerial General talk about HikaSerial Serial: Bug Report Serial: How to? Support en Français de HikaSerial (French Support) HikaSubscription HikaAuction Auction: Feature requests Auction: How to? Auction: Bug report Hikashop around the world Support en Français (French Support) Russian FAQ. Курс выживания с Hikashop. Частые вопросы и о Расширения Hikashop Наши сайты на Hikashop 日本語版サポート(Japanese Support) Thai German Archives Bug Report How to?

[](/forum/topics/feed/mode-topics?format=feed&type=rss)

Time to create page: 0.082 seconds

[Powered by](/forum/credits) [Kunena Forum](https://www.kunena.org)
