Zen Cart Logo
If this is your first visit, check our documentation. To post, register or login.
Forums / General Questions / General Questions / Resize Dimension of Product Additional Images Independently of the Centred Content?

Resize Dimension of Product Additional Images Independently of the Centred Content?

Locked
This thread is locked. New replies are disabled.
5 May 2010, 8:14 AM
#1
limelites avatar

limelites

Totally Zenned

Join Date:
Jan 2009
Posts:
2,085
Plugin Contributions:
0

Post #1 by limelites

Does anyone know if there's a way to resize the images in the centred content areas (new products, all products and specials) without the changes taking effect on the additional images?

At present, when I resize the thumbnails in admin/images/Small Image Width, the centred content changes as desired, but unfortunately, this also effects the product Additional Images.

How can I resize dimensions on the product Additional Images independently of the centred content images?

5 May 2010, 9:18 AM
#3
limelites avatar

limelites

Totally Zenned

Join Date:
Jan 2009
Posts:
2,085
Plugin Contributions:
0

Post #3 by limelites

Perhaps I could size the additional images by hard coding /includes/modules/custom/additional_images.php

I can see the following code:

$thumb_slashes = zen_image($base_image, addslashes($products_name), SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT);

Is there some way to edit that code so that it would define the small image width and small image height in pixels?

5 May 2010, 9:29 AM
#4
limelites avatar

limelites

Totally Zenned

Join Date:
Jan 2009
Posts:
2,085
Plugin Contributions:
0

Post #4 by limelites

When I change this:

$thumb_slashes = zen_image($base_image, addslashes($products_name), SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT);

to this:

$thumb_slashes = zen_image($base_image, addslashes($products_name));

......... it definitely makes the product additional images stop sizing with the centred content images. Therefore, if I could figure out the proper PHP code for this, then I'd be laughing:

$thumb_slashes = zen_image($base_image, addslashes($products_name), 125px, 188px);

I've never been good with PHP. Can anyone tell me how to write that properly please?

5 May 2010, 9:43 AM
#5
get_em_fast avatar

get_em_fast

Totally Zenned

Join Date:
Dec 2006
Location:
Seligman, MO U.S.A.
Posts:
2,072
Plugin Contributions:
1

Post #5 by get_em_fast

Put the code in your stylesheet.css like so:

.new_products img {
  height: 100px; 
  width: 50px;
}

.all_products img {
  height: 100px; 
  width: 50px;
}

.specialsListBoxContents img {
  height: 100px; 
  width: 50px;
}

Hope this helps.

Teach them to shop and they will shop today;
Teach them to Zen and they will OWN a shop tomorrow!

5 May 2010, 9:44 AM
#6
limelites avatar

limelites

Totally Zenned

Join Date:
Jan 2009
Posts:
2,085
Plugin Contributions:
0

Post #6 by limelites

OK, sussed it out.... here's the solution:

$thumb_slashes = zen_image($base_image, addslashes($products_name), $width=125, $height=188);

5 May 2010, 9:48 AM
#7
limelites avatar

limelites

Totally Zenned

Join Date:
Jan 2009
Posts:
2,085
Plugin Contributions:
0

Post #7 by limelites

Get em Fast, I never seen your reply but I feel stupid now since it's so simple :)

5 May 2010, 9:52 AM
#8
limelites avatar

limelites

Totally Zenned

Join Date:
Jan 2009
Posts:
2,085
Plugin Contributions:
0

Post #8 by limelites

Ah, on second thoughts that doesn't work. Changing the size in CSS is just stretching the image and making it pixelated.

5 May 2010, 10:22 AM
#9
get_em_fast avatar

get_em_fast

Totally Zenned

Join Date:
Dec 2006
Location:
Seligman, MO U.S.A.
Posts:
2,072
Plugin Contributions:
1

Post #9 by get_em_fast

Hmmmm......looked good on my end.

Teach them to shop and they will shop today;
Teach them to Zen and they will OWN a shop tomorrow!

5 May 2010, 10:30 AM
#10
limelites avatar

limelites

Totally Zenned

Join Date:
Jan 2009
Posts:
2,085
Plugin Contributions:
0

Post #10 by limelites

Get Em Fast:

Hmmmm......looked good on my end.

Probably looked good because I'd already resized the images via admin/config/images... which resizes by generating the image in the desired dimension. Stretching in CSS looked pretty awful as it was pixelated.

I've fixed it now though... https://www.silkblooms.co.uk if you wanna look.

I just hard coded the additional_images.php file to override the SMALL_IMAGE_WIDTH. Looks good now.

5 May 2010, 10:40 AM
#11
get_em_fast avatar

get_em_fast

Totally Zenned

Join Date:
Dec 2006
Location:
Seligman, MO U.S.A.
Posts:
2,072
Plugin Contributions:
1

Post #11 by get_em_fast

Ah Ha! Now I see where all this confusion came from.......I just assumed that you wanted the images on LimeLites smaller, and it never even dawned on me that you may be working on another site, in which you needed to make the images bigger, in which I knew would pixelate with css. I shouldn't just assume, should I? Well, anyway, I'm proud to see you get it all worked out.

Sorry about that, :huh:
Robert

Teach them to shop and they will shop today;
Teach them to Zen and they will OWN a shop tomorrow!

5 May 2010, 10:48 AM
#12
limelites avatar

limelites

Totally Zenned

Join Date:
Jan 2009
Posts:
2,085
Plugin Contributions:
0

Post #12 by limelites

It's me who should aplogise for the confusion. I should have mentioned in the OP that it was for me new flower store on https://www.silkblooms.co.uk

Thank you Robert for helping me out. That's what's good about Zen Cart, always someone here to help :smile: