Jump to content

product image box and zoom


Recommended Posts

Hello All,

 

I have the following problem: in order to display products I make pictures 3:2; 4:3 or 19:9 (usually I make 3:2).

 

When uploading the box is squared. As result I have a white part on the top and the picture looks also smaller.

 

I think I can probably crop them squared but beside being quite long if everytime I need to rework images, I was wondering whether I can adapt the box (so to make it right for a 4:3 image);

My main problem is the zoom. In other words I would be interested in having this box bigger. So I am not interested in reducing the height but increasing the width to the size of a 3:2 image.

 

Here my site:

 

http://www.homedesign.fr/index.php

Link to comment
Share on other sites

There are two parts to Prestashop. The core PHP files and the smarty display files .tpl

 

Images size is controlled in three places,

 

Preferences > Images

 

This provide you with many predefined variables. Your Theme and modules are already using these image sizes. In some cases you can just change the image size to achieve what you want. But this is not always the case because often the corresponding size is also set in the display .tpl and/or CSS file.

 

The good news is they are easy to edit and change.

 

When you view a page in your browser, use the view source to see the code. Take note of the images in use and if they have size attributes.

 

For example from one of my default installs,

 

5-53-home/ipod-touch.jpg

 

The numbers correspond to category and image id, the image size in use is "home". My third party theme doesn't use image attributes so I only need to go to Preferences > Images and change the image variable "home" and I'm done.

 

From your site this image is taken from your home page.

http://www.homedesig...ome_default.jpg

 

It is using the "home_default" image variable and in the code it has size attributes set, height="124" width="124"

 

The images appear in your "HOT PRODUCTS" section which is actually the Home Featured Module. It is located at,

 

prestashop\modules\homefeatured

 

The file you need to edit is homefeatured.tpl

 

However, in this case homefeatured.tpl is not hard coded. It uses varibles for the size.

 

height="{$homeSize.height}" width="{$homeSize.width}"

 

So GREAT. in this case you just need to go to,

 

Preferences > Images and change the size of "home_default".

 

So is that all?

 

Pretty much, but you need to remember one more thing. After you enter an image in Prestashop it only generates all the images sizes once. So if you change an image size in Preferences > Images, it will only affect new images you add after you make the change.

 

To change the sizes of existing images you must regenerate.

 

Preferences > Images > Regenerate thumbnails

 

I also recommend before you Regenerate thumbnails, go to,

 

Advanced Parameters > Performance

 

Set Template cache to Force compilation

 

And set Cache to off

 

You should leave those settings in place until you have completed all work on your web site.

Link to comment
Share on other sites

×
×
  • Create New...