- Posts: 193
- Thank you received: 76
Default product image not displayed
11 years 8 months ago - 11 years 8 months ago #185388
by korzo
Default product image not displayed was created by korzo
-- 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->_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.
-- 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->_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 8 months ago by korzo.
The following user(s) said Thank You: ChristiaanR
Please Log in or Create an account to join the conversation.
11 years 8 months ago #185422
by Xavier
Replied by Xavier on topic Default product image not displayed
Hi,
Thanks for you report, I just corrected that issue on our end.
Thanks for you report, I just corrected that issue on our end.
Please Log in or Create an account to join the conversation.
Less
More
- Posts: 7
- Thank you received: 1
11 years 8 months ago #187048
by Olivier2093
Replied by Olivier2093 on topic Default product image not displayed
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
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 or Create an account to join the conversation.
11 years 8 months ago #187052
by korzo
Replied by korzo on topic Default product image not displayed
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
to
In the file administrator\components\com_hikashop\helpers\image.php
change line 505 from
Code:
$img = $this->_getImage($fullFilename, $extension);
Code:
$extension = strtolower(substr($filename, strrpos($filename, '.') + 1));
$img = $this->_getImage($fullFilename, $extension);
The following user(s) said Thank You: Olivier2093
Please Log in or Create an account to join the conversation.
Less
More
- Posts: 7
- Thank you received: 1
11 years 8 months ago - 11 years 8 months ago #187053
by Olivier2093
Replied by Olivier2093 on topic Default product image not displayed
Thanks, I will try it tonight
Olivier
Edit :
TESTED => OK
Thank you for your rapidity.
Olivier
Olivier
Edit :
TESTED => OK
Thank you for your rapidity.
Olivier
Last edit: 11 years 8 months ago by Olivier2093.
Please Log in or Create an account to join the conversation.
Time to create page: 0.185 seconds