different image size on product listing &categorie

  • Posts: 307
  • Thank you received: 22
11 years 3 months ago #156914

Hi,

Is it possible to have a different thumbnail size for the product listing and the categorie image ?

When we click on a categorie we now use the article/table layout with images of 100px, wich is perfect.

But the side effect is that the thumbnails of the categories are also 100px instead of 200px (wich I would like them to be.

Did I miss a setting somewhere or should this be done with a css modification ?
Any tips on the last part would be appreciated, especially on wich class to modify without breaking something else ;)

Thanks,
Nico

-- HikaShop version -- : 2.3.0
-- Joomla version -- : 3.3.0

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

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

Hi,

What can be done is set the image size to 200px. Then edit the view "product / listing_img_title" and replace the line:

			$img = $this->image->getThumbnail(@$this->row->file_path, array('width' => $this->image->main_thumbnail_x, 'height' => $this->image->main_thumbnail_y), $image_options);
By:
			$img = $this->image->getThumbnail(@$this->row->file_path, array('width' => 100, 'height' => 100), $image_options);

The following user(s) said Thank You: nico.van.leeuwen

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

  • Posts: 307
  • Thank you received: 22
11 years 3 months ago #157096

Hi Xavier,

This mod works perfectly for reducing the size of the product images in the view I use (which is the listing_table in stead of listing_img_title).
There is a small side effect and that is that the rows of the table still reserve space for 200px in stead of 100px.

I could be wrong (not very good at php) but is this set several lines above the change we made ?
I found this line of code :

<div style="height:<?php echo $divHeight;?>px;text-align:center;clear:both;" class="hikashop_product_image">

Is this the one to change by replacing the php echo code with something like 100px ?

Thanks for the feedback,
Nico

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

  • Posts: 307
  • Thank you received: 22
11 years 3 months ago #157099

Hi Xavier,

I found it myself, and it works !
Thanks again for the inspiration, just what I needed.

For eveybody who would like to achieve the same, this is the original code in the listing_table view :

<div style="height:<?php echo $divHeight;?>px;text-align:center;clear:both;" class="hikashop_product_image">
								<div style="position:relative;text-align:center;clear:both;width:<?php echo $divWidth;?>px;margin: auto;" class="hikashop_product_image_subdiv">

And this is what I made of it :
<div style="height:100px;text-align:center;clear:both;" class="hikashop_product_image">
								<div style="position:relative;text-align:center;clear:both;width:100px;margin: auto;" class="hikashop_product_image_subdiv">

Nico

Last edit: 11 years 3 months ago by nico.van.leeuwen. Reason: added some code

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

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

Hi,

Yes it was indeed what must be done. Thanks for having shared your solution :)

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

Time to create page: 0.071 seconds
Powered by Kunena Forum