[HOW TO] Cloud-zoom and Opencart step by step guide 1.5.1.3
Posted: Sun Dec 25, 2011 3:57 am
This is my first post here, but I've taken lots of help and info from the forum so far for my store. By means of giving back here is a 'how to' that I wrote whilst installing cloud-zoom on my opencart shop. Please feel free to comment or ask questions.
Cloud-zoom is a javascript image-magnifier, more info here: http://www.professorcloud.com/mainsite/cloud-zoom.htm
View the implementation on my opencart demo page here: http://demo.bananamanana.com/test
Copy the file cloud-zoom.css to /catalog/view/theme/default/stylesheet
Copy file cloud-zoom.1.0.2.js to a new directory called /catalog/view/javascript/jquery/cloud-zoom/
Create a backup of header.tpl called header.tpl.orig in directory /catalog/view/theme/default/template/common/
Edit header.tpl, to add a reference to the cloud-zoom stylesheet, ajax sctipt hosted on google and the cloud-zoom script.
Find: <link rel="stylesheet" type="text/css" href="catalog/view/theme/default/stylesheet/stylesheet.css" />
After it, add:
<link href="/catalog/view/theme/default/stylesheet/cloud-zoom.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jq ... "></script>
<script type="text/JavaScript" src="/catalog/view/javascript/jquery/cloud-zoom/cloud-zoom.1.0.2.js"></script>
Create a bcakup of product.tpl called product.tpl.orig in directory /catalog/view/theme/default/template/product/
On or around line 13 find:
<div class="image"><a href="<?php echo $popup; ?>" title="<?php echo $heading_title; ?>" class="fancybox" rel="fancybox">
Chance to:
<div class="image"><a href="<?php echo $popup; ?>" title="<?php echo $heading_title; ?>" class="cloud-zoom" id='zoom1' rel="adjustX: 10, adjustY:-4">
For additional image gallery, on line 18 find:
<a href="<?php echo $image['popup']; ?>" title="<?php echo $heading_title; ?>" class="fancybox" rel="fancybox">
<a href="<?php echo $image['popup']; ?>" title="<?php echo $heading_title; ?>" class="cloud-zoom-gallery" rel="useZoom: 'zoom1', smallImage: '<?php echo $image['thumb']; ?>' ">
Just after on the same line, find:
<img src="<?php echo $image['thumb']; ?>"
Change to: <img src="<?php echo $image['thumb']; ?>" width="76" height="76" *see below for an explanation of why.
Getting it looking right.
If you look at your page now it will work fine for products with a single image but it wont look right for products with multiple images.
The additional images aren't cached as tiny small and large in opencart.
The default size for additional images are tiny and large.
We can increase the tiny image to be small, then scale these small images down to tiny for use for thumbnails.
In backoffice>settings>image> Additional Product Image Size:
Increase to 228px x 228px (or whatever you have Product Image Thumb Size set to)
In product.tpl after <img src="<?php echo $image['thumb']; ?>" add width="76" height="76"
In stylesheet.css you can play around with margin-left under
.product-info .image-additional a { & .product-info .image-additional {
I changed margin left to 8px and -8px respectively.
To persolalise your cloud-zoom just play around with the rel"....." on line ~13 of product.tpl check the paramaters given here http://www.professorcloud.com/mainsite/ ... ration.htm and maybe mess with cloud-zoom.css
That's it you should now have a working install of cloud-zoom on opencart. Tested working on 1.5.1.3.
Cloud-zoom is a javascript image-magnifier, more info here: http://www.professorcloud.com/mainsite/cloud-zoom.htm
View the implementation on my opencart demo page here: http://demo.bananamanana.com/test
Copy the file cloud-zoom.css to /catalog/view/theme/default/stylesheet
Copy file cloud-zoom.1.0.2.js to a new directory called /catalog/view/javascript/jquery/cloud-zoom/
Create a backup of header.tpl called header.tpl.orig in directory /catalog/view/theme/default/template/common/
Edit header.tpl, to add a reference to the cloud-zoom stylesheet, ajax sctipt hosted on google and the cloud-zoom script.
Find: <link rel="stylesheet" type="text/css" href="catalog/view/theme/default/stylesheet/stylesheet.css" />
After it, add:
<link href="/catalog/view/theme/default/stylesheet/cloud-zoom.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jq ... "></script>
<script type="text/JavaScript" src="/catalog/view/javascript/jquery/cloud-zoom/cloud-zoom.1.0.2.js"></script>
Create a bcakup of product.tpl called product.tpl.orig in directory /catalog/view/theme/default/template/product/
On or around line 13 find:
<div class="image"><a href="<?php echo $popup; ?>" title="<?php echo $heading_title; ?>" class="fancybox" rel="fancybox">
Chance to:
<div class="image"><a href="<?php echo $popup; ?>" title="<?php echo $heading_title; ?>" class="cloud-zoom" id='zoom1' rel="adjustX: 10, adjustY:-4">
For additional image gallery, on line 18 find:
<a href="<?php echo $image['popup']; ?>" title="<?php echo $heading_title; ?>" class="fancybox" rel="fancybox">
<a href="<?php echo $image['popup']; ?>" title="<?php echo $heading_title; ?>" class="cloud-zoom-gallery" rel="useZoom: 'zoom1', smallImage: '<?php echo $image['thumb']; ?>' ">
Just after on the same line, find:
<img src="<?php echo $image['thumb']; ?>"
Change to: <img src="<?php echo $image['thumb']; ?>" width="76" height="76" *see below for an explanation of why.
Getting it looking right.
If you look at your page now it will work fine for products with a single image but it wont look right for products with multiple images.
The additional images aren't cached as tiny small and large in opencart.
The default size for additional images are tiny and large.
We can increase the tiny image to be small, then scale these small images down to tiny for use for thumbnails.
In backoffice>settings>image> Additional Product Image Size:
Increase to 228px x 228px (or whatever you have Product Image Thumb Size set to)
In product.tpl after <img src="<?php echo $image['thumb']; ?>" add width="76" height="76"
In stylesheet.css you can play around with margin-left under
.product-info .image-additional a { & .product-info .image-additional {
I changed margin left to 8px and -8px respectively.
To persolalise your cloud-zoom just play around with the rel"....." on line ~13 of product.tpl check the paramaters given here http://www.professorcloud.com/mainsite/ ... ration.htm and maybe mess with cloud-zoom.css
That's it you should now have a working install of cloud-zoom on opencart. Tested working on 1.5.1.3.