Layout Bug - Product Page and Thumbnails

  • Posts: 41
  • Thank you received: 0
11 years 11 months ago #81691

I isolated the problem but can't figure out a solution.
1. Set thumbnail size to 250px on width only in Configuration/files
2. If I load an image that is smaller then 250px in width then the description text is behind the image.
3. When I use firebug it says the div "hikashop_product_main_image" height: 20px
4. I went into file show_block_img.php and noticed these codes:
$style = ' style="height:' . ($height +20) . 'px;"'
AND
<div style="height:<?php echo $divHeight+20;?>px;text-align:center;clear:both;" class="hikashop_product_main_image">

I'm assuming that "20" is where it's getting that css. So Im assuming when there is no image that's what it puts in but like I said earlier this css pops in when I load an image that is smaller then what I sent for thumbnails size. I have a large catalog and image sizes are all over the place.

For example this image I loaded has a width of 225px. You can see what happens to the description. If I change the settings in configuration/files to 225px then it works fine. But I need to have that setting at 250px since I have images sizes all over the place.

Thanks

Attachments:

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

  • Posts: 26158
  • Thank you received: 4028
  • MODERATOR
11 years 11 months ago #81771

Hi,

This bug has been fixed in the latest HikaShop package.
There is a french topic which explain the bug fix:
www.hikashop.com/en/forum/5-support-en-f...-le-texte.html#80912

Here the "translated" version:

This fix has to be apply on the view "product | show_block_img" of your front-end template.
It is a classical override which would replace:

<div style="height:<?php echo $divHeight+20;?>px;text-align:center;clear:both;" class="hikashop_product_main_image">
By:
<div style="<?php if(!empty($divHeight)){ echo 'height:'.($divHeight+20).'px;'; } ?>text-align:center;clear:both;" class="hikashop_product_main_image">


Regards,


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

Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.
The following user(s) said Thank You: gteigland

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

  • Posts: 41
  • Thank you received: 0
11 years 11 months ago #81784

Worked great!

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

  • Posts: 41
  • Thank you received: 0
11 years 11 months ago #82232

Now I discover a new problem but related. If the thumbnail is smaller then what I set then in the category view with all the products, it blows up the image and then affects all the other ones after it. See image attached. Is there a code that needs to be replaced in category view as well.

Thanks!

Attachments:

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

  • Posts: 26158
  • Thank you received: 4028
  • MODERATOR
11 years 11 months ago #82439

Hi,

Could you provide a link to your store ?
I think there is a file access problem because you have some missing images.

Regards,


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

Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.

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

  • Posts: 41
  • Thank you received: 0
11 years 11 months ago #82441

Actually I know it's not a file url problem. Because for example on this page:
new.furnitureandthings.com/browse-produc...57-occasional-tables

The "Chairside Cabinet" is causing the problem. When I resize that image to what I set for thumbnails (150px or above) then everything works fine. Right now that image for Chairside Cabinet is smaller then 150px which for whatever reason is messing up the rest of the products on that page.

It's a similar problem showing up on the category page.

Does that make sense?

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

  • Posts: 13201
  • Thank you received: 2322
11 years 11 months ago #82548

The link provided doesn't work.
Could you check that ?

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

  • Posts: 41
  • Thank you received: 0
11 years 11 months ago #82591

Sorry.. This should work.
furnitureandthings.com/index.php?option=...al-tables&Itemid=389

YOU HAVE TO GO TO PAGE 5 in that category to see the issue.

Thanks

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

  • Posts: 82868
  • Thank you received: 13377
  • MODERATOR
11 years 11 months ago #82863

Ok, I see what it the problem.

It's because the system uses the first image of the listing in order to decide of the ideal size when you don't specify one of the dimensions for the thumbnails and since the normal image of your product is smaller that the dimension that you specified for the thumbnails, the system ignores it and it considers that no thumbnails are necessary for the images.

Please change the code:

if(empty($width)){
				list($width, $height) = $this->scaleImage($theImage->width, $theImage->height, 0, $height);
			}
			if(empty($height)){
				list($width, $height) = $this->scaleImage($theImage->width, $theImage->height, $width, 0);
			}
to:
if(empty($width)){
				if($theImage->height >= $height){
					list($width, $height) = $this->scaleImage($theImage->width, $theImage->height, 0, $height);
				}else{
					$width=$this->image->main_thumbnail_x;
				}
			}
			if(empty($height)){
				if($theImage->width >= $width){
					list($width, $height) = $this->scaleImage($theImage->width, $theImage->height, $width, 0);
				}else{
					$height=$this->image->main_thumbnail_y;
				}
			}
in the file administrator/components/com_hikashop/helpers/image.php and that should avoid that issue.

The following user(s) said Thank You: gteigland

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

Time to create page: 0.076 seconds
Powered by Kunena Forum