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

#   Fetch extra image

##

- **[esotechie](/forum/user/7143-esotechie "View esotechie's Profile")**
- [![esotechie's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar7143.jpg)](/forum/user/7143-esotechie "View esotechie's Profile") Topic Author
- [ Offline](/forum/user/7143-esotechie)

Less More

- Posts: 180
- Thank you received: 13
-
-
-
- [](http://www.halare.co.uk/)
-

13 years 5 months ago [\#108807](#108807) by [esotechie](/forum/user/7143-esotechie "View esotechie's Profile")  *[Fetch extra image](/forum/4-how-to/83612-fetch-extra-image#108807 "I am looking to modify the listing&#95;img&#95;title file so that it also includes the second image for a product if there is one, so it can be used on a roll-over.  What is the simplest way of fetching the second image for a product if there is one?")* was created by *[esotechie](/forum/user/7143-esotechie "View esotechie's Profile")*

I am looking to modify the listing_img_title file so that it also includes the second image for a product if there is one, so it can be used on a roll-over.

What is the simplest way of fetching the second image for a product if there is one?

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

- **[Eliot](/forum/user/1824-eliot "View Eliot's Profile")**
- [![Eliot's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar1824.png)](/forum/user/1824-eliot "View Eliot's Profile")
- [ Offline](/forum/user/1824-eliot)

Less More

- Posts: 2334
- Thank you received: 403
-
-

13 years 5 months ago [\#108833](#108833) by [Eliot](/forum/user/1824-eliot "View Eliot's Profile")  Replied by *[Eliot](/forum/user/1824-eliot "View Eliot's Profile")* on topic *[Fetch extra image](/forum/4-how-to/83612-fetch-extra-image#108833 "I am looking to modify the listing&#95;img&#95;title file so that it also includes the second image for a product if there is one, so it can be used on a roll-over.  What is the simplest way of fetching the second image for a product if there is one?")*

Hi there,

To do so, you have to take a look at the view.html.php which is loading the information.
First you should edit these lines to make them load every images related to your product:
Code:

$queryImage = 'SELECT * FROM '.hikashop_table('file').' WHERE file_ref_id IN ('.implode(',',$ids).') AND file_type=\'product\' ORDER BY file_ref_id ASC, file_ordering ASC, file_id ASC'; $database-&gt;setQuery($queryImage); $images = $database-&gt;loadObjectList(); foreach($rows as $k=&gt;$row){ if(!empty($images)){ foreach($images as $image){ if($row-&gt;product_id==$image-&gt;file_ref_id){ if(!isset($row-&gt;file_ref_id)){ foreach(get_object_vars($image) as $key =&gt; $name){ $rows[$k]-&gt;$key = $name; } } break; } } } if(!isset($rows[$k]-&gt;file_name)){ $rows[$k]-&gt;file_name = $row-&gt;product_name; } }

then you will be able to modify the listing_img_title to display 2 images if it's possible.
Do not hesitate to ask if you have more questions ![;)](/media/kunena/emoticons/24.png ";)")

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

- **[esotechie](/forum/user/7143-esotechie "View esotechie's Profile")**
- [![esotechie's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar7143.jpg)](/forum/user/7143-esotechie "View esotechie's Profile") Topic Author
- [ Offline](/forum/user/7143-esotechie)

Less More

- Posts: 180
- Thank you received: 13
-
-
-
- [](http://www.halare.co.uk/)
-

13 years 5 months ago [\#108881](#108881) by [esotechie](/forum/user/7143-esotechie "View esotechie's Profile")  Replied by *[esotechie](/forum/user/7143-esotechie "View esotechie's Profile")* on topic *[Fetch extra image](/forum/4-how-to/83612-fetch-extra-image#108881 "I am looking to modify the listing&#95;img&#95;title file so that it also includes the second image for a product if there is one, so it can be used on a roll-over.  What is the simplest way of fetching the second image for a product if there is one?")*

Thank you Eliot

That was very helpful.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzgzNjEyLWZldGNoLWV4dHJhLWltYWdlP3RtcGw9bWFya2Rvd24=) 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.051 seconds

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