Zen Cart Logo
Forums / All Other Contributions/Addons / Swap Images via MouseOver or Click

Swap Images via MouseOver or Click

Views: 1,675

Results 1 to 9 of 9
14 Jun 2011, 8:53 AM
#1
cheekycockney avatar

cheekycockney

Zen Follower

Join Date:
Apr 2006
Posts:
172
Plugin Contributions:
0

Swap Images via MouseOver or Click

Hi. I have installed this module on to my 1.3.9 cart, (http://www.zen-cart.com/index.php?main_page=product_contrib_info&products_id=311) although it's not yet working properly for me. Currently it has simply removed the option for me to enlarge my main product image!
http://www.a c i d f r e e.co.uk/catalog/index.php?main_page=product_info&cPath=3&products_id=4

Firstly, I'm not sure exactly what images it wants to be swapping/enlarging, I have Additional Product Images (http://www.zen-cart.com/index.php?main_page=product_contrib_info&cPath=40_47&products_id=1554) installed which works great but I'm not sure that these are the images the Swap Images mod wants to be using as it makes no mention of it? Any pointers there would be great.

Also, I think I should point out I also have the Attribute Image module installed which may be conflicting? I am no longer using this mod so if this is an issue i am happy to remove any problematic code.

Thanks in advance!

14 Jun 2011, 11:57 AM
#2
website_rob avatar

website_rob

Inactive

Join Date:
Oct 2006
Location:
Alberta, Canada
Posts:
4,572
Plugin Contributions:
0

Re: Swap Images via MouseOver or Click

Your image naming convention seems to be incorrect.

http://www. acidfree .co.uk/catalog/images/queenie_black.jpg
and
http://www. acidfree .co.uk/catalog/images/queenie_white.jpg

As additional images uses an underscore based on the main product image name, one of the above has to be renamed to just 'queenie.jpg'.

14 Jun 2011, 3:23 PM
#3
cheekycockney avatar

cheekycockney

Zen Follower

Join Date:
Apr 2006
Posts:
172
Plugin Contributions:
0

Re: Swap Images via MouseOver or Click

Hi Rob, thanks for the reply. I wasn't aware of any naming conventions could you please point me in the direction of this info?

I have renamed one of the images to simply 'queenie' but with no luck. To be honest I've probably misunderstood you as I don't quite see the benefit?

14 Jun 2011, 3:37 PM
#4
cheekycockney avatar

cheekycockney

Zen Follower

Join Date:
Apr 2006
Posts:
172
Plugin Contributions:
0

Re: Swap Images via MouseOver or Click

I just thought I should point out, all additional images aside, I lose the option to enlarge the main product image when I replace my version of includes/templates/mytemplatename/templates/trp_modules_main_product_image.php with the new version from the imageswap mod. Putting the older version back fixes it. Hopefully this helps narrow down on the issue?

15 Jun 2011, 3:41 AM
#5
website_rob avatar

website_rob

Inactive

Join Date:
Oct 2006
Location:
Alberta, Canada
Posts:
4,572
Plugin Contributions:
0

Re: Swap Images via MouseOver or Click

You could search the FAQs on 'images' to find out more about naming.

In looking at your page code I see there are many errors and cannot separate problems with the swap images. Also, there could be a problem with the Image Swap module files and other module files not playing nice together.

15 Jun 2011, 11:02 AM
#6
cheekycockney avatar

cheekycockney

Zen Follower

Join Date:
Apr 2006
Posts:
172
Plugin Contributions:
0

Re: Swap Images via MouseOver or Click

Thanks again Rob, after reading up on the naming conventions I have realised that they relate to a built-in feature of Zen Cart, as does the ImageSwap mod I have been trying to use. I was confusing them with the Additional Images mod I also have installed. So with that in mind I have ditched the unnecessary images mod and I'm now using the built-in images feature and naming conventions appropriately.

This has shown some progress, the imageswap is now working exactly as I had hoped, the only problem that remains now is that my original product image can not be enlarged with a click as it could before. I'm starting to wonder if this is an error on my side or if it is simply the way the swap mod is designed, as looking at my previous tpl_modules_main_product_image.php file compared with the imageswap mod version it looks ike this functionaltity has simply been left out? My PHP is not great but that's what it looks like to me. If so, could the missing code simply be worked into the imageswap mod version and work alongside it?

Original Code

<script language="javascript" type="text/javascript"><!-- document.write('<?php echo '<a href="javascript:popupWindow(\\\'' . zen_href_link(FILENAME_POPUP_IMAGE, 'pID=' . $_GET['products_id']) . '\\\')">' . zen_image($products_image_medium, addslashes($products_name), MEDIUM_IMAGE_WIDTH, MEDIUM_IMAGE_HEIGHT) . '<br /><span class="imgLink">' . TEXT_CLICK_TO_ENLARGE . '</span></a>'; ?>'); Image Swap mod code <script language="javascript" type="text/javascript"><!-- document.write('<?php echo $ahref_start . zen_image($products_image_medium, addslashes($products_name), MEDIUM_IMAGE_WIDTH, MEDIUM_IMAGE_HEIGHT, 'name="imageSwap"') . $enlarge_text . $ahref_end; ?>'); Thanks again.
20 Jun 2011, 6:03 PM
#7
cheekycockney avatar

cheekycockney

Zen Follower

Join Date:
Apr 2006
Posts:
172
Plugin Contributions:
0

Re: Swap Images via MouseOver or Click

Bumping... as this is the only thing stopping my site from going live now! All that's left to fix is the missing 'enlarge image' functionality on the main product image, hopefully my assumptions in my previous post are correct?

21 Jun 2011, 6:20 AM
#8
website_rob avatar

website_rob

Inactive

Join Date:
Oct 2006
Location:
Alberta, Canada
Posts:
4,572
Plugin Contributions:
0

Re: Swap Images via MouseOver or Click

The image swap module appears to remove the larger image link from the main image and instead, uses the additional images for the larger link. I do believe the module allows to replace the additional image with main image on mouseover whereas, you currently have it set to show main image again on mouseout. Read the module instructions for more information and/or add your main image as an additional so it to, will have a larger link.

21 Jun 2011, 8:39 AM
#9
cheekycockney avatar

cheekycockney

Zen Follower

Join Date:
Apr 2006
Posts:
172
Plugin Contributions:
0

Re: Swap Images via MouseOver or Click

Ah, thanks Rob, it's nice to know I haven't screwed it up! I considered adding the main image as an additional image as you suggested although my client is keen for the main image to clickable and I tend to agree... it seems a lilttle bit unintuitive to have a preview image that is not clickable. I will have a go at adding the functionality back in if it's at all possible, although if it seems like an impossible task please let me know!