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

#   display next product image

##

- **[kyratn](/forum/user/38342-kyratn "View kyratn's Profile")**
- [![kyratn's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/gallery/redswirl.jpg)](/forum/user/38342-kyratn "View kyratn's Profile") Topic Author
- [ Offline](/forum/user/38342-kyratn)

Less More

- Posts: 1119
- Thank you received: 114
-
- [](http://kyra.lt)
-

10 years 6 months ago [\#238149](#238149) by [kyratn](/forum/user/38342-kyratn "View kyratn's Profile")  *[display next product image](/forum/4-how-to/884138-display-next-product-image#238149 "Hi,  What code I could use to add image for the next or previous product buttons? My code looks something like this:  Thanks")* was created by *[kyratn](/forum/user/38342-kyratn "View kyratn's Profile")*

Hi,

What code I could use to add image for the next or previous product buttons?
My code looks something like this:
Code:

&lt;a href="&lt;?php echo $this-&gt;links-&gt;next;?&gt;"&gt;&lt;span class="pull-left"&gt;&lt;i class='icon-angle-left'&gt;&lt;/i&gt; &lt;?php echo $this-&gt;links-&gt;next_product-&gt;product_name;?&gt;&lt;/span&gt; &lt;img src="NEXT_PRODUCT_IMG_PATH" height="145" width="115"&gt;&lt;/a&gt;

Thanks

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzg4NDEzOC1kaXNwbGF5LW5leHQtcHJvZHVjdC1pbWFnZT90bXBsPW1hcmtkb3du) 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")
- [ Away](/forum/user/63-nicolas)

Less More

- Posts: 86576
- Thank you received: 14320
-
-

10 years 6 months ago [\#238241](#238241) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[display next product image](/forum/4-how-to/884138-display-next-product-image#238241 "Hi,  What code I could use to add image for the next or previous product buttons? My code looks something like this:  Thanks")*

Hi,

You'll need to add a MySQL query in order to load the data of the images from the hikashop_file table and then use the getThumbnail of the helper.image to generate the thumbnail and finally echo its URL inside the src of an img tag.

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

- **[kyratn](/forum/user/38342-kyratn "View kyratn's Profile")**
- [![kyratn's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/gallery/redswirl.jpg)](/forum/user/38342-kyratn "View kyratn's Profile") Topic Author
- [ Offline](/forum/user/38342-kyratn)

Less More

- Posts: 1119
- Thank you received: 114
-
- [](http://kyra.lt)
-

10 years 6 months ago [\#238361](#238361) by [kyratn](/forum/user/38342-kyratn "View kyratn's Profile")  Replied by *[kyratn](/forum/user/38342-kyratn "View kyratn's Profile")* on topic *[display next product image](/forum/4-how-to/884138-display-next-product-image#238361 "Hi,  What code I could use to add image for the next or previous product buttons? My code looks something like this:  Thanks")*

Hi,

As usual thank you for replay Nicolas.
I see I need to do 3 things. Only one is the issue for me. How to add a MySQL query? Could you please give me some quick example?

Regards

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzg4NDEzOC1kaXNwbGF5LW5leHQtcHJvZHVjdC1pbWFnZT90bXBsPW1hcmtkb3du) 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")
- [ Away](/forum/user/63-nicolas)

Less More

- Posts: 86576
- Thank you received: 14320
-
-

10 years 6 months ago [\#238376](#238376) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[display next product image](/forum/4-how-to/884138-display-next-product-image#238376 "Hi,  What code I could use to add image for the next or previous product buttons? My code looks something like this:  Thanks")*

Hi,

It's quite easy actually: Code:

&lt;?php $db = JFactory::getDBO(); $db-&gt;setQuery('SELECT * FROM #__hikashop_file WHERE file_type=\'product\' AND file_ref_id=\''.(int)$this-&gt;links-&gt;next_product-&gt;product_id.'\''); $image = $db-&gt;loadObject(); ?&gt;

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

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

Less More

- Posts: 217
- Thank you received: 4
-
-

10 years 1 month ago [\#251248](#251248) by [FilipHradil](/forum/user/36153-filiphradil "View FilipHradil's Profile")  Replied by *[FilipHradil](/forum/user/36153-filiphradil "View FilipHradil's Profile")* on topic *[display next product image](/forum/4-how-to/884138-display-next-product-image#251248 "Hi,  What code I could use to add image for the next or previous product buttons? My code looks something like this:  Thanks")*

Hello, how can I show image then? ![:)](/media/kunena/emoticons/3.png ":)")

Thank you

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzg4NDEzOC1kaXNwbGF5LW5leHQtcHJvZHVjdC1pbWFnZT90bXBsPW1hcmtkb3du) 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: 26401
- Thank you received: 4081
-
- [](http://obsi.dev)
-

10 years 1 month ago [\#251250](#251250) by [Jerome](/forum/user/80-jerome "View Jerome's Profile")  Replied by *[Jerome](/forum/user/80-jerome "View Jerome's Profile")* on topic *[display next product image](/forum/4-how-to/884138-display-next-product-image#251250 "Hi,  What code I could use to add image for the next or previous product buttons? My code looks something like this:  Thanks")*

Hi,

You can take a look at the code in the view "product / show_block_image" and see how the image helper and the function getThumbnail can be used.

Regards,

---

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

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

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

Less More

- Posts: 217
- Thank you received: 4
-
-

10 years 1 month ago -  10 years 1 month ago [\#251294](#251294) by [FilipHradil](/forum/user/36153-filiphradil "View FilipHradil's Profile")  Replied by *[FilipHradil](/forum/user/36153-filiphradil "View FilipHradil's Profile")* on topic *[display next product image](/forum/4-how-to/884138-display-next-product-image#251294 "Hi,  What code I could use to add image for the next or previous product buttons? My code looks something like this:  Thanks")*

Thank you. I did it!

Now it shows me image of next product.

**Can you also advise me how to load next product of next product in this way?**

Thís ís my current code:
Code:

$db-&gt;setQuery('SELECT * FROM #__hikashop_file WHERE file_type=\'product\' AND file_ref_id=\''.(int)$this-&gt;links-&gt;next_product-&gt;product_id.'\''); $img1 = $db-&gt;loadObject(); $img = $this-&gt;image-&gt;getThumbnail(@str_replace("-2","-1",$img1-&gt;file_path), array('width' =&gt; $width, 'height' =&gt; $height), $image_options); echo '&lt;img class="'.$classname.'" title="'.$this-&gt;escape(@$img1-&gt;file_description).'" alt="'.$this-&gt;escape(@$img1-&gt;file_name).'" src="'.$img-&gt;url.'"/&gt;';

Last edit: 10 years 1 month ago by [FilipHradil](/forum/user/36153-filiphradil "View FilipHradil's Profile").

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzg4NDEzOC1kaXNwbGF5LW5leHQtcHJvZHVjdC1pbWFnZT90bXBsPW1hcmtkb3du) 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")
- [ Away](/forum/user/63-nicolas)

Less More

- Posts: 86576
- Thank you received: 14320
-
-

10 years 1 month ago [\#251329](#251329) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[display next product image](/forum/4-how-to/884138-display-next-product-image#251329 "Hi,  What code I could use to add image for the next or previous product buttons? My code looks something like this:  Thanks")*

Hi,

The next product is not known. So it's more complex as it will require using a complex algorithm like there is in the components/com_hikashop/views/product/view.html.php file to initialize the $this-&gt;links variable but basing yourself on the $this-&gt;links-&gt;next_product variable instead of $this-&gt;element

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

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