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

#   choose which product image is displayed

##

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

Less More

- Posts: 2697
- Thank you received: 74
-
-

12 years 9 months ago -  12 years 9 months ago [\#140050](#140050) by [erickb](/forum/user/4069-erickb "View erickb's Profile")  *[choose which product image is displayed](/forum/50-feature-request/865068-choose-which-product-image-is-displayed#140050 "in Hikashop the code to display a product image looks like that --&gt;  echo $this-&gt;image-&gt;display(@$this-&gt;row-&gt;file&#95;path,false,$this-&gt;escape($this-&gt;row-&gt;file&#95;name), '' , '' , $this-&gt;image-&gt;main&#95;thumbnail&#95;x, $this-&gt;image-&gt;main&#95;thumbnail&#95;y);  there is no way to choose which file&#95;ordering one want  it will be useful to have it in that way --&gt; image-&gt;display(@$this-&gt;row-&gt;file&#95;path,false,$this-&gt;escape($this-&gt;row-&gt;file&#95;name), $this-&gt;row-&gt;file&#95;ordering, '' ,'','' $this-&gt;image-&gt;main&#95;thumbnail&#95;x, $this-&gt;image-&gt;main&#95;thumbnail&#95;y);  or --&gt;  image-&gt;display(@$this-&gt;row-&gt;images&#91;2&#93;-&gt;file&#95;path,false,$this-&gt;escape($this-&gt;row-&gt;file&#95;name), $this-&gt;row-&gt;file&#95;ordering, '' ,'','' $this-&gt;image-&gt;main&#95;thumbnail&#95;x, $this-&gt;image-&gt;main&#95;thumbnail&#95;y);")* was created by *[erickb](/forum/user/4069-erickb "View erickb's Profile")*

in Hikashop the code to display a product image looks like that --&gt;

echo $this-&gt;image-&gt;display(@$this-&gt;row-&gt;file_path,false,$this-&gt;escape($this-&gt;row-&gt;file_name), '' , '' , $this-&gt;image-&gt;main_thumbnail_x, $this-&gt;image-&gt;main_thumbnail_y);

there is no way to choose which file_ordering one want

it will be useful to have it in that way --&gt;
image-&gt;display(@$this-&gt;row-&gt;file_path,false,$this-&gt;escape($this-&gt;row-&gt;file_name), **$this-&gt;row-&gt;file\_ordering**, '' ,'','' $this-&gt;image-&gt;main_thumbnail_x, $this-&gt;image-&gt;main_thumbnail_y);

or --&gt;

image-&gt;display(@$this-&gt;row-&gt;**images\[2\]-&gt;**file_path,false,$this-&gt;escape($this-&gt;row-&gt;file_name), $this-&gt;row-&gt;file_ordering, '' ,'','' $this-&gt;image-&gt;main_thumbnail_x, $this-&gt;image-&gt;main_thumbnail_y);

Last edit: 12 years 9 months ago by [erickb](/forum/user/4069-erickb "View erickb's Profile").

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzUwLWZlYXR1cmUtcmVxdWVzdC84NjUwNjgtY2hvb3NlLXdoaWNoLXByb2R1Y3QtaW1hZ2UtaXMtZGlzcGxheWVkP3RtcGw9bWFya2Rvd24=) or [Create an account](/register) 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: 86326
- Thank you received: 14288
-
-

12 years 9 months ago [\#140066](#140066) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[choose which product image is displayed](/forum/50-feature-request/865068-choose-which-product-image-is-displayed#140066 "in Hikashop the code to display a product image looks like that --&gt;  echo $this-&gt;image-&gt;display(@$this-&gt;row-&gt;file&#95;path,false,$this-&gt;escape($this-&gt;row-&gt;file&#95;name), '' , '' , $this-&gt;image-&gt;main&#95;thumbnail&#95;x, $this-&gt;image-&gt;main&#95;thumbnail&#95;y);  there is no way to choose which file&#95;ordering one want  it will be useful to have it in that way --&gt; image-&gt;display(@$this-&gt;row-&gt;file&#95;path,false,$this-&gt;escape($this-&gt;row-&gt;file&#95;name), $this-&gt;row-&gt;file&#95;ordering, '' ,'','' $this-&gt;image-&gt;main&#95;thumbnail&#95;x, $this-&gt;image-&gt;main&#95;thumbnail&#95;y);  or --&gt;  image-&gt;display(@$this-&gt;row-&gt;images&#91;2&#93;-&gt;file&#95;path,false,$this-&gt;escape($this-&gt;row-&gt;file&#95;name), $this-&gt;row-&gt;file&#95;ordering, '' ,'','' $this-&gt;image-&gt;main&#95;thumbnail&#95;x, $this-&gt;image-&gt;main&#95;thumbnail&#95;y);")*

If you look on the images listing of the product edition page, you'll find a "ordering" column where you can set the ordering of each image. No need to change the code for that then.

The display function comes from the file administrator/components/com_hikashop/helpers/image.php

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzUwLWZlYXR1cmUtcmVxdWVzdC84NjUwNjgtY2hvb3NlLXdoaWNoLXByb2R1Y3QtaW1hZ2UtaXMtZGlzcGxheWVkP3RtcGw9bWFya2Rvd24=) or [Create an account](/register) to join the conversation.

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

Less More

- Posts: 2697
- Thank you received: 74
-
-

12 years 9 months ago [\#140067](#140067) by [erickb](/forum/user/4069-erickb "View erickb's Profile")  Replied by *[erickb](/forum/user/4069-erickb "View erickb's Profile")* on topic *[choose which product image is displayed](/forum/50-feature-request/865068-choose-which-product-image-is-displayed#140067 "in Hikashop the code to display a product image looks like that --&gt;  echo $this-&gt;image-&gt;display(@$this-&gt;row-&gt;file&#95;path,false,$this-&gt;escape($this-&gt;row-&gt;file&#95;name), '' , '' , $this-&gt;image-&gt;main&#95;thumbnail&#95;x, $this-&gt;image-&gt;main&#95;thumbnail&#95;y);  there is no way to choose which file&#95;ordering one want  it will be useful to have it in that way --&gt; image-&gt;display(@$this-&gt;row-&gt;file&#95;path,false,$this-&gt;escape($this-&gt;row-&gt;file&#95;name), $this-&gt;row-&gt;file&#95;ordering, '' ,'','' $this-&gt;image-&gt;main&#95;thumbnail&#95;x, $this-&gt;image-&gt;main&#95;thumbnail&#95;y);  or --&gt;  image-&gt;display(@$this-&gt;row-&gt;images&#91;2&#93;-&gt;file&#95;path,false,$this-&gt;escape($this-&gt;row-&gt;file&#95;name), $this-&gt;row-&gt;file&#95;ordering, '' ,'','' $this-&gt;image-&gt;main&#95;thumbnail&#95;x, $this-&gt;image-&gt;main&#95;thumbnail&#95;y);")*

no it is not enough in that way I want to display [0] for products, but [1] for related or last visited
and sometimes I need [0] and [1] as default icons

your way to display images is far too restrictive

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzUwLWZlYXR1cmUtcmVxdWVzdC84NjUwNjgtY2hvb3NlLXdoaWNoLXByb2R1Y3QtaW1hZ2UtaXMtZGlzcGxheWVkP3RtcGw9bWFya2Rvd24=) or [Create an account](/register) 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: 26394
- Thank you received: 4077
-
- [](http://obsi.dev)
-

12 years 9 months ago [\#140079](#140079) by [Jerome](/forum/user/80-jerome "View Jerome's Profile")  Replied by *[Jerome](/forum/user/80-jerome "View Jerome's Profile")* on topic *[choose which product image is displayed](/forum/50-feature-request/865068-choose-which-product-image-is-displayed#140079 "in Hikashop the code to display a product image looks like that --&gt;  echo $this-&gt;image-&gt;display(@$this-&gt;row-&gt;file&#95;path,false,$this-&gt;escape($this-&gt;row-&gt;file&#95;name), '' , '' , $this-&gt;image-&gt;main&#95;thumbnail&#95;x, $this-&gt;image-&gt;main&#95;thumbnail&#95;y);  there is no way to choose which file&#95;ordering one want  it will be useful to have it in that way --&gt; image-&gt;display(@$this-&gt;row-&gt;file&#95;path,false,$this-&gt;escape($this-&gt;row-&gt;file&#95;name), $this-&gt;row-&gt;file&#95;ordering, '' ,'','' $this-&gt;image-&gt;main&#95;thumbnail&#95;x, $this-&gt;image-&gt;main&#95;thumbnail&#95;y);  or --&gt;  image-&gt;display(@$this-&gt;row-&gt;images&#91;2&#93;-&gt;file&#95;path,false,$this-&gt;escape($this-&gt;row-&gt;file&#95;name), $this-&gt;row-&gt;file&#95;ordering, '' ,'','' $this-&gt;image-&gt;main&#95;thumbnail&#95;x, $this-&gt;image-&gt;main&#95;thumbnail&#95;y);")*

Hi,

1 - You can override it, so it's not restrictive.
2 - We do not use anymore the function "display" in the product page, we use the "getThumbnail" one.

Regards,

---

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

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzUwLWZlYXR1cmUtcmVxdWVzdC84NjUwNjgtY2hvb3NlLXdoaWNoLXByb2R1Y3QtaW1hZ2UtaXMtZGlzcGxheWVkP3RtcGw9bWFya2Rvd24=) or [Create an account](/register) to join the conversation.

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

Less More

- Posts: 2697
- Thank you received: 74
-
-

12 years 9 months ago [\#140433](#140433) by [erickb](/forum/user/4069-erickb "View erickb's Profile")  Replied by *[erickb](/forum/user/4069-erickb "View erickb's Profile")* on topic *[choose which product image is displayed](/forum/50-feature-request/865068-choose-which-product-image-is-displayed#140433 "in Hikashop the code to display a product image looks like that --&gt;  echo $this-&gt;image-&gt;display(@$this-&gt;row-&gt;file&#95;path,false,$this-&gt;escape($this-&gt;row-&gt;file&#95;name), '' , '' , $this-&gt;image-&gt;main&#95;thumbnail&#95;x, $this-&gt;image-&gt;main&#95;thumbnail&#95;y);  there is no way to choose which file&#95;ordering one want  it will be useful to have it in that way --&gt; image-&gt;display(@$this-&gt;row-&gt;file&#95;path,false,$this-&gt;escape($this-&gt;row-&gt;file&#95;name), $this-&gt;row-&gt;file&#95;ordering, '' ,'','' $this-&gt;image-&gt;main&#95;thumbnail&#95;x, $this-&gt;image-&gt;main&#95;thumbnail&#95;y);  or --&gt;  image-&gt;display(@$this-&gt;row-&gt;images&#91;2&#93;-&gt;file&#95;path,false,$this-&gt;escape($this-&gt;row-&gt;file&#95;name), $this-&gt;row-&gt;file&#95;ordering, '' ,'','' $this-&gt;image-&gt;main&#95;thumbnail&#95;x, $this-&gt;image-&gt;main&#95;thumbnail&#95;y);")*

> Jerome wrote: Hi,
>
> 1 - You can override it, so it's not restrictive.
> 2 - We do not use anymore the function "display" in the product page, we use the "getThumbnail" one.
>
> Regards,

1) for each place where I want another images I must use $db =&amp; JFactory::getDBO(); I find it vdery restrictive

2) in HK 223 &gt; listing_img.php you are using echo $this-&gt;image-&gt;display

anyway that feature to choose which image one want is missing

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzUwLWZlYXR1cmUtcmVxdWVzdC84NjUwNjgtY2hvb3NlLXdoaWNoLXByb2R1Y3QtaW1hZ2UtaXMtZGlzcGxheWVkP3RtcGw9bWFya2Rvd24=) or [Create an account](/register) 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.069 seconds

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