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

#   Display first Image from product

##

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

Less More

- Posts: 9
- Thank you received: 0
-
-

12 years 3 months ago -  12 years 3 months ago [\#163811](#163811) by [hanibaltrs](/forum/user/31958-hanibaltrs "View hanibaltrs's Profile")  *[Display first Image from product](/forum/26-product-category-display/869661-display-first-image-from-product#163811 "-- HikaShop version -- : 2.2 -- Joomla version -- : 2.5.22  Hi,  is there any shortcut from product listing list view to have the first image from the product ?? because i wanna make a drop down with the products (already did) and wanna have displayed the first product image next to the selected product.. so far i have:  which does the drop down, once the product is selected it should have the image displayed (coding part i will make..only need the shortcut like &quot;php echo $this-&gt;row-&gt;firstimage&quot; ?? is there any variable i can call to have this first image ? array for the foreach loop is also fine to have a better point of view image is attached (it's a calculator based on the custom values &amp; products which are in the shop it calculates via js/php")* was created by *[hanibaltrs](/forum/user/31958-hanibaltrs "View hanibaltrs's Profile")*

-- HikaShop version -- : 2.2
-- Joomla version -- : 2.5.22

Hi,

is there any shortcut from product listing list view to have the first image from the product ??
because i wanna make a drop down with the products (already did) and wanna have displayed the first product image next to the selected product.. so far i have: Code:

&lt;select id="model2" name="model2" onchange="ersparnis();"&gt; &lt;?php foreach($this-&gt;rows as $row){ $this-&gt;row =&amp; $row;?&gt; &lt;option value="&lt;?php echo $this-&gt;row-&gt;verbrauchauf100km022kwh;?&gt;"&gt;&lt;?php echo $row-&gt;product_name;?&gt;&lt;/option&gt;&lt;?php } ?&gt;&lt;/select&gt;

which does the drop down, once the product is selected it should have the image displayed (coding part i will make..only need the shortcut like "php echo $this-&gt;row-&gt;firstimage" ??
is there any variable i can call to have this first image ?
array for the foreach loop is also fine to have a better point of view image is attached (it's a calculator based on the custom values &amp; products which are in the shop it calculates via js/php

[ ![hef60c63.png](/forum/attachment/18402) ](/forum/attachment/18402 "hef60c63.png")

- [ ![hef60c63.png](/forum/attachment/18402) ](/forum/attachment/18402 "hef60c63.png") [ ](/forum/attachment/18402?download=1 "hef60c63.png")

Last edit: 12 years 3 months ago by [Jerome](/forum/user/80-jerome "View Jerome's Profile"). Reason: [code] is nice !!

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

12 years 3 months ago [\#163814](#163814) by [Jerome](/forum/user/80-jerome "View Jerome's Profile")  Replied by *[Jerome](/forum/user/80-jerome "View Jerome's Profile")* on topic *[Display first Image from product](/forum/26-product-category-display/869661-display-first-image-from-product#163814 "-- HikaShop version -- : 2.2 -- Joomla version -- : 2.5.22  Hi,  is there any shortcut from product listing list view to have the first image from the product ?? because i wanna make a drop down with the products (already did) and wanna have displayed the first product image next to the selected product.. so far i have:  which does the drop down, once the product is selected it should have the image displayed (coding part i will make..only need the shortcut like &quot;php echo $this-&gt;row-&gt;firstimage&quot; ?? is there any variable i can call to have this first image ? array for the foreach loop is also fine to have a better point of view image is attached (it's a calculator based on the custom values &amp; products which are in the shop it calculates via js/php")*

Hi,

I do not understand your question.
Some product listing, like "listing_img_title" display the image of the product.. A lot of listing allow you to display the image of the product.
You can simply re-use the existing code in order to do the same. Code:

$image_options = array('default' =&gt; true,'forcesize'=&gt;$this-&gt;config-&gt;get('image_force_size',true),'scale'=&gt;$this-&gt;config-&gt;get('image_scale_mode','inside')); $img = $this-&gt;image-&gt;getThumbnail(@$this-&gt;row-&gt;file_path, array('width' =&gt; $this-&gt;image-&gt;main_thumbnail_x, 'height' =&gt; $this-&gt;image-&gt;main_thumbnail_y), $image_options); if($img-&gt;success) { echo '&lt;img class="hikashop_product_listing_image" title="'.$this-&gt;escape(@$this-&gt;row-&gt;file_description).'" alt="'.$this-&gt;escape(@$this-&gt;row-&gt;file_name).'" src="'.$img-&gt;url.'"/&gt;'; }

Regards,

---

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

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

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

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

Less More

- Posts: 9
- Thank you received: 0
-
-

12 years 3 months ago [\#163977](#163977) by [hanibaltrs](/forum/user/31958-hanibaltrs "View hanibaltrs's Profile")  Replied by *[hanibaltrs](/forum/user/31958-hanibaltrs "View hanibaltrs's Profile")* on topic *[Display first Image from product](/forum/26-product-category-display/869661-display-first-image-from-product#163977 "-- HikaShop version -- : 2.2 -- Joomla version -- : 2.5.22  Hi,  is there any shortcut from product listing list view to have the first image from the product ?? because i wanna make a drop down with the products (already did) and wanna have displayed the first product image next to the selected product.. so far i have:  which does the drop down, once the product is selected it should have the image displayed (coding part i will make..only need the shortcut like &quot;php echo $this-&gt;row-&gt;firstimage&quot; ?? is there any variable i can call to have this first image ? array for the foreach loop is also fine to have a better point of view image is attached (it's a calculator based on the custom values &amp; products which are in the shop it calculates via js/php")*

great, thanks for hit, works perfectly.. looks like this..

- [ ![ha43f399.png](/forum/attachment/18427) ](/forum/attachment/18427 "ha43f399.png") [ ](/forum/attachment/18427?download=1 "ha43f399.png")

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

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

[](#top)
