Jump to content

[SOLVED] Product Image Enlarge


Recommended Posts

Hi, I am new to prestashop and need some help. I uploaded a 750x500 pxl image of one of my products. But when I click on it to enlarge, it does not open in its original size. How and where do I need to make changes to open a product's image on its original size when clicked on enlarge image.
Thanks.

Link to comment
Share on other sites

To have the original uploaded image display in thickbox instead of resized thickbox images, change line 118 (in PrestaShop v1.3.1) of prdouct.tpl in your theme's directory from:

<a href="{$link->getImageLink($product->link_rewrite, $imageIds, 'thickbox')}" rel="other-views" class="thickbox {if $smarty.foreach.thumbnails.first}shown{/if}" title="{$image.legend|htmlspecialchars}">



to:

<a href="{$link->getImageLink($product->link_rewrite, $imageIds)}" rel="other-views" class="thickbox {if $smarty.foreach.thumbnails.first}shown{/if}" title="{$image.legend|htmlspecialchars}">



and line 277 (in PrestaShop v1.3.1) of js/product.js in your theme's directory from:

var newSrc = domAAroundImgThumb.attr('href').replace('thickbox','large');



to:

var newSrc = domAAroundImgThumb.attr('href').replace('.jpg','-large.jpg');

Link to comment
Share on other sites

  • 5 months later...
  • 2 months later...
  • 4 weeks later...

Rocky, I wonder if you can help. I have followed the suggestions in this module to crop my images to a nice square: http://www.prestashop.com/forums/viewthread/15210/installing_prestashop/trick__crop_images_inside_preserve_ratio_no_white_spaces_arround_image

This works just fine. However, I wouldlike to show the image at it's original dimensions (i.e. not cropped) for the thickbox. If I leave it unchanged, the thinckbox image also gets cropped to a square, so I followed your instructions here to show the original image in the thickbox.

HOWEVER, although the cover image for the product loks fine and so do the thicknox images, when I rollover a thumbnail, the bigpic is changed to an images that is sqaushed into the square, rather than cropped. From looking at Firebug, I can see that while the source for the cover image big pic is:

src="/10-106-large/product1.jpg


the image source for big pic when I roll over the thumb i s:

src="/10-106/product1-large.jpg



What do I need to change to get this working so that when the bigpic is changed it is at the same proportions as the cover pic?

Link to comment
Share on other sites

Hmm, just thinking about this - is there a way that we can append -original to the original image when it is uploaded then this could be changed to

var newSrc = domAAroundImgThumb.attr('href').replace('original','large'); 



That could work???

Link to comment
Share on other sites

  • 2 months later...

Rocky,

how to enable the full size on PS1.4? I followed the steps and changed the .tpl and .js files. Now it loads the image in full size but scales it down again in the fancyfox. i.e. the image is in full size but the surrounding fancybox isn't. Must be something in fancybox css /js?

Link to comment
Share on other sites

Rocky,

how to enable the full size on PS1.4? I followed the steps and changed the .tpl and .js files. Now it loads the image in full size but scales it down again in the fancyfox. i.e. the image is in full size but the surrounding fancybox isn't. Must be something in fancybox css /js?


i have the same problem with 1.4.2.5... the mods was working good but with watermark there was problems ehehe...
Link to comment
Share on other sites

  • 5 months later...
  • 2 months later...
  • 1 month later...
  • 3 months later...

To have the original uploaded image display in thickbox instead of resized thickbox images, change line 118 (in PrestaShop v1.3.1) of prdouct.tpl in your theme's directory from:

 

<a href="{$link->getImageLink($product->link_rewrite, $imageIds, 'thickbox')}" rel="other-views" class="thickbox {if $smarty.foreach.thumbnails.first}shown{/if}" title="{$image.legend|htmlspecialchars}">

 

to:

 

<a href="{$link->getImageLink($product->link_rewrite, $imageIds)}" rel="other-views" class="thickbox {if $smarty.foreach.thumbnails.first}shown{/if}" title="{$image.legend|htmlspecialchars}">

 

and line 277 (in PrestaShop v1.3.1) of js/product.js in your theme's directory from:

 

var newSrc = domAAroundImgThumb.attr('href').replace('thickbox','large');

 

to:

 

var newSrc = domAAroundImgThumb.attr('href').replace('.jpg','-large.jpg');

Hi, Rocky!

About the image product, when I click any image of the fitured product at homepage, the product image is disappear, meanwhile the thickbox image is no problem. How to appear these product images? I use version 1.4.1

Link to comment
Share on other sites

  • 1 year later...

To have the original uploaded image display in thickbox instead of resized thickbox images, change line 118 (in PrestaShop v1.3.1) of prdouct.tpl in your theme's directory from:

 

<a href="{$link->getImageLink($product->link_rewrite, $imageIds, 'thickbox')}" rel="other-views" class="thickbox {if $smarty.foreach.thumbnails.first}shown{/if}" title="{$image.legend|htmlspecialchars}">
to:

 

<a href="{$link->getImageLink($product->link_rewrite, $imageIds)}" rel="other-views" class="thickbox {if $smarty.foreach.thumbnails.first}shown{/if}" title="{$image.legend|htmlspecialchars}">
and line 277 (in PrestaShop v1.3.1) of js/product.js in your theme's directory from:

 

var newSrc = domAAroundImgThumb.attr('href').replace('thickbox','large');
to:

 

var newSrc = domAAroundImgThumb.attr('href').replace('.jpg','-large.jpg');

 

the original uploaded image 1024x2000px, but image enlarge only 268x525px. how to fix?

1385315_470411546406085_1260635488_n.png

Edited by Trungvision (see edit history)
Link to comment
Share on other sites

×
×
  • Create New...