Thumbnails not displaying on product page

  • Posts: 7
  • Thank you received: 0
11 years 5 months ago #107692

If I upload a product image that is not in the exact height / width ratio as set in the configuration > images, then it does not show up on the page. I can click on it and the full size image is shown, just not the thumbnail.

If I inspect the code then I can see it is calling for an image in a directory thumbnail_100x74, however the image is in directory thumbnail_100x100, which is the default thumbnail size.

It appears the software automatically creates the thumbnail to the size set in the configuration, but the page is looking for the exact size thumbnail.

How do I fix this please.

Thanks for your help

Attachments:

Please Log in or Create an account to join the conversation.

  • Posts: 82759
  • Thank you received: 13346
  • MODERATOR
11 years 5 months ago #107696

That's because the customized view that you're using hasn't been made to work with anything else than images with the correct ratio as it was done for a very old version of HikaShop and that the code changed since then.

You would need to change the line:

 <?php echo $this->image->display($image->file_path,true,$image->file_name,'id="hikashop_main_image" style="margin-top:10px;margin-bottom:10px;display:inline-block;vertical-align:middle"','id="hikashop_main_image_link"'); ?>

to:
<?php
			$height = $this->config->get('product_image_y');
			$width = $this->config->get('product_image_x');
			if(empty($height)) $height=$this->config->get('thumbnail_y');
			if(empty($width)) $width=$this->config->get('thumbnail_x');
			$divWidth=$width;
			$divHeight=$height;
			$this->image->checkSize($divWidth,$divHeight,$image);
echo $this->image->display(@$image->file_path,true,@$image->file_name,'id="hikashop_main_image'.$variant_name.'" style="margin-top:10px;margin-bottom:10px;display:inline-block;vertical-align:middle"','id="hikashop_main_image_link"', $width,  $height);
?>

The following user(s) said Thank You: noisypenguin

Please Log in or Create an account to join the conversation.

  • Posts: 7
  • Thank you received: 0
11 years 5 months ago #107857

Thank you

Please Log in or Create an account to join the conversation.

Time to create page: 0.048 seconds
Powered by Kunena Forum