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

#   Default product image not displayed

##

- **[korzo](/forum/user/34428-korzo "View korzo's Profile")**
- [![korzo's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar34428.png)](/forum/user/34428-korzo "View korzo's Profile") Topic Author
- [ Offline](/forum/user/34428-korzo)

Less More

- Posts: 193
- Thank you received: 76
-
-

11 years 9 months ago -  11 years 9 months ago [\#185388](#185388) by [korzo](/forum/user/34428-korzo "View korzo's Profile")  *[Default product image not displayed](/forum/3-bug-report/874031-default-product-image-not-displayed#185388 "-- HikaShop version -- : 2.3.5 -- Joomla version -- : 3.3.6  When product has no image, default image is not displayed in any view(administration, category listing, product detail). Also there are notices:  Problem is in method hikashopImageHelper::getThumbnail(). In Hikashop 2.3.5 assignment  were moved from line 437 to the start of method. As $filename is in this case null(product has no image), $extension will be also null and call to method $this-&gt;&#95;getImage() will return null instead of object.  Solution is to move assignment in question after line 374.  When you will try to reproduce this bug, don't forget to delete cached thumbnails.")* was created by *[korzo](/forum/user/34428-korzo "View korzo's Profile")*

-- HikaShop version -- : 2.3.5
-- Joomla version -- : 3.3.6

When product has no image, default image is not displayed in any view(administration, category listing, product detail).
Also there are notices: Code:

Notice: Trying to get property of non-object in components\com_hikashop\views\product\tmpl\listing_img_title.php on line 24 Notice: Trying to get property of non-object in components\com_hikashop\views\product\tmpl\show_block_img.php on line 64 Notice: Trying to get property of non-object in administrator\components\com_hikashop\views\product\tmpl\listing.php on line 182

Problem is in method hikashopImageHelper::getThumbnail(). In Hikashop 2.3.5 assignment Code:

$extension = strtolower(substr($filename, strrpos($filename, '.') + 1));

were moved from line 437 to the start of method. As $filename is in this case null(product has no image), $extension will be also null and call to method $this-&gt;_getImage() will return null instead of object.

Solution is to move assignment in question after line 374.

When you will try to reproduce this bug, don't forget to delete cached thumbnails.

Last edit: 11 years 9 months ago by [korzo](/forum/user/34428-korzo "View korzo's Profile").

The following user(s) said Thank You: [ChristiaanR](/forum/user/35637-christiaanr "View ChristiaanR's Profile")

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

11 years 9 months ago [\#185422](#185422) by [Xavier](/forum/user/4105-xavier "View Xavier's Profile")  Replied by *[Xavier](/forum/user/4105-xavier "View Xavier's Profile")* on topic *[Default product image not displayed](/forum/3-bug-report/874031-default-product-image-not-displayed#185422 "-- HikaShop version -- : 2.3.5 -- Joomla version -- : 3.3.6  When product has no image, default image is not displayed in any view(administration, category listing, product detail). Also there are notices:  Problem is in method hikashopImageHelper::getThumbnail(). In Hikashop 2.3.5 assignment  were moved from line 437 to the start of method. As $filename is in this case null(product has no image), $extension will be also null and call to method $this-&gt;&#95;getImage() will return null instead of object.  Solution is to move assignment in question after line 374.  When you will try to reproduce this bug, don't forget to delete cached thumbnails.")*

Hi,

Thanks for you report, I just corrected that issue on our end.

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

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

Less More

- Posts: 7
- Thank you received: 1
-
-

11 years 9 months ago [\#187048](#187048) by [Olivier2093](/forum/user/35780-olivier2093 "View Olivier2093's Profile")  Replied by *[Olivier2093](/forum/user/35780-olivier2093 "View Olivier2093's Profile")* on topic *[Default product image not displayed](/forum/3-bug-report/874031-default-product-image-not-displayed#187048 "-- HikaShop version -- : 2.3.5 -- Joomla version -- : 3.3.6  When product has no image, default image is not displayed in any view(administration, category listing, product detail). Also there are notices:  Problem is in method hikashopImageHelper::getThumbnail(). In Hikashop 2.3.5 assignment  were moved from line 437 to the start of method. As $filename is in this case null(product has no image), $extension will be also null and call to method $this-&gt;&#95;getImage() will return null instead of object.  Solution is to move assignment in question after line 374.  When you will try to reproduce this bug, don't forget to delete cached thumbnails.")*

Hello,
I encountered this problem and would be please to resolve it before the official correction
Could you please explain me in which file I have to :
"move assignment in question after line 374."
Thanks
Olivier

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

- **[korzo](/forum/user/34428-korzo "View korzo's Profile")**
- [![korzo's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar34428.png)](/forum/user/34428-korzo "View korzo's Profile") Topic Author
- [ Offline](/forum/user/34428-korzo)

Less More

- Posts: 193
- Thank you received: 76
-
-

11 years 9 months ago [\#187052](#187052) by [korzo](/forum/user/34428-korzo "View korzo's Profile")  Replied by *[korzo](/forum/user/34428-korzo "View korzo's Profile")* on topic *[Default product image not displayed](/forum/3-bug-report/874031-default-product-image-not-displayed#187052 "-- HikaShop version -- : 2.3.5 -- Joomla version -- : 3.3.6  When product has no image, default image is not displayed in any view(administration, category listing, product detail). Also there are notices:  Problem is in method hikashopImageHelper::getThumbnail(). In Hikashop 2.3.5 assignment  were moved from line 437 to the start of method. As $filename is in this case null(product has no image), $extension will be also null and call to method $this-&gt;&#95;getImage() will return null instead of object.  Solution is to move assignment in question after line 374.  When you will try to reproduce this bug, don't forget to delete cached thumbnails.")*

You are right. It was not fixed yet in installation package.

In the file administrator\components\com_hikashop\helpers\image.php
change line 505 from Code:

$img = $this-&gt;_getImage($fullFilename, $extension);

to Code:

$extension = strtolower(substr($filename, strrpos($filename, '.') + 1)); $img = $this-&gt;_getImage($fullFilename, $extension);

The following user(s) said Thank You: [Olivier2093](/forum/user/35780-olivier2093 "View Olivier2093's Profile")

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

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

Less More

- Posts: 7
- Thank you received: 1
-
-

11 years 9 months ago -  11 years 9 months ago [\#187053](#187053) by [Olivier2093](/forum/user/35780-olivier2093 "View Olivier2093's Profile")  Replied by *[Olivier2093](/forum/user/35780-olivier2093 "View Olivier2093's Profile")* on topic *[Default product image not displayed](/forum/3-bug-report/874031-default-product-image-not-displayed#187053 "-- HikaShop version -- : 2.3.5 -- Joomla version -- : 3.3.6  When product has no image, default image is not displayed in any view(administration, category listing, product detail). Also there are notices:  Problem is in method hikashopImageHelper::getThumbnail(). In Hikashop 2.3.5 assignment  were moved from line 437 to the start of method. As $filename is in this case null(product has no image), $extension will be also null and call to method $this-&gt;&#95;getImage() will return null instead of object.  Solution is to move assignment in question after line 374.  When you will try to reproduce this bug, don't forget to delete cached thumbnails.")*

Thanks, I will try it tonight
Olivier

Edit :
TESTED =&gt; OK
Thank you for your rapidity.
Olivier

Last edit: 11 years 9 months ago by [Olivier2093](/forum/user/35780-olivier2093 "View Olivier2093's Profile").

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

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

[](#top)
