This is a tutorial about how to show original size images with thickbox/lightbox in prestashop 1.6 prestashop 1.7. If your product images are not in the same dimensions, for example some of them are in 800x800, the others are in 1200x1200. If you want to show all of them as large as possible, then you may set large_default image type to be in 1200x1200, but by doing that, images smaller than that size will be added white borders, which is not we wanted. I guess the best solution would be showing original size images in thickbox/lightbox. Original size images are images you uploaded for your product, they are un-resized.
How to show original size images with thickbox lightbox in prestashop 1.7
To achieve that you need to do a small customization to one theme file.
Edit the \themes\yourthemename\templates\catalog\_partials\product-cover-thumbnails.tpl file.
Replace this code
1 | {$image.bySize.superlarge_default.url} |
By this one
1 | {$image.bySize.superlarge_default.url|replace:'-superlarge_default':''} |
If you set the "Product gallerys:" option in the theme editor to "Display images of the current combination with a show all images button", then you need to edit one more file, which is the \themes\yourthemename\assets\js\theme.js To replace the second
1 | e.bySize.superlarge_default.url |
With this one
1 | e.bySize.superlarge_default.url.replace('-superlarge_default','') |
Edit the \themes\yourthemename\product.tpl file.
Replace this code
1 | {$link->getImageLink($product->link_rewrite, $imageIds, 'thickbox_default')|escape:'html':'UTF-8'} |
By this one.
1 | {$link->getImageLink($product->link_rewrite, $imageIds, 'thickbox_default')|escape:'html':'UTF-8'|replace:'-thickbox_default':''} |
Unfortunately, requires a lot customizations.
Ouestion - how to apply watermark to original images? This will be very usefull for me. can you help with that?
1.6 or 1.7? Which module you are using to apply watermarks?