Zen Cart Logo
Forums / Templates, Stylesheets, Page Layout / Make additional images NOT clickable

Make additional images NOT clickable

Views: 2,175

Results 1 to 13 of 13
21 Jun 2012, 10:36 AM
#1
justrimless avatar

justrimless

Zen Follower

Join Date:
Aug 2006
Posts:
127
Plugin Contributions:
0

Make additional images NOT clickable

I have image handler installed so my additional images pop up into full size on mouseover.

So I would like to stop them from being a clickable link.

I am reasonably sure that I need to remove some of the bits of the code below, from additional_images.php,

// Link Preparation:
$script_link = '<script language="javascript" type="text/javascript"><!--' . "\n" . 'document.write(\'' . ($flag_display_large ? 'javascript:popupWindow(\\\'' . $large_link . '\\\')">' . $thumb_slashes . '<br />' . TEXT_CLICK_TO_ENLARGE . '' : $thumb_slashes) . '\');' . "\n" . '//--></script>';

$noscript_link = '<noscript>' . ($flag_display_large ? '<a href="' . zen_href_link(FILENAME_POPUP_IMAGE_ADDITIONAL, 'pID=' . $_GET['products_id'] . '&pic=' . $i . '&products_image_large_additional=' . $products_image_large) . '" target="_blank">' . $thumb_regular . '<br /><span class="imgLinkAdditional">' . TEXT_CLICK_TO_ENLARGE . '</span></a>' : $thumb_regular ) . '</noscript>';

I have had go but can't get it right. Any help would be appreciated.

As ever with Zencart I wonder if there is a simpler way, if there is please point it out.

Many thanks.

21 Jun 2012, 10:52 AM
#2
dgent avatar

dgent

Totally Zenned

Join Date:
Nov 2009
Location:
UK
Posts:
1,117
Plugin Contributions:
0

Re: Make additional images NOT clickable

Just below that you have

$alternate_link = '<a href="' . $products_image_large . '" title="' . $products_name . '" rel="lightbox">' . $thumb_regular . '<br />' . TEXT_CLICK_TO_ENLARGE . '</a>';

Change it to

$alternate_link = $thumb_regular;

21 Jun 2012, 11:11 AM
#3
justrimless avatar

justrimless

Zen Follower

Join Date:
Aug 2006
Posts:
127
Plugin Contributions:
0

Re: Make additional images NOT clickable

Hi, thanks for your reply.

I tried what you said but it didn't help, I wonder if you've missed my intention.

I want the image to enlarge on mouseover, as it does now, but I don't want ti ti be clickable.

Cheers,
Rick

21 Jun 2012, 11:17 AM
#4
dgent avatar

dgent

Totally Zenned

Join Date:
Nov 2009
Location:
UK
Posts:
1,117
Plugin Contributions:
0

Re: Make additional images NOT clickable

Well it does exactly that on a standard store, I don't know how this affects your mouse over part.

21 Jun 2012, 11:24 AM
#5
justrimless avatar

justrimless

Zen Follower

Join Date:
Aug 2006
Posts:
127
Plugin Contributions:
0

Re: Make additional images NOT clickable

Here is what I have for link preparation in it's entirety,

// Link Preparation:
$script_link = '<script language="javascript" type="text/javascript"><!--' . "\n" . 'document.write(\'' . ($flag_display_large ? '<a href="javascript:popupWindow(\\\'' . $large_link . '\\\')">' . $thumb_slashes . '<br />' . TEXT_CLICK_TO_ENLARGE . '</a>' : $thumb_slashes) . '\');' . "\n" . '//--></script>';

$noscript_link = '<noscript>' . ($flag_display_large ? '<a href="' . zen_href_link(FILENAME_POPUP_IMAGE_ADDITIONAL, 'pID=' . $_GET['products_id'] . '&pic=' . $i . '&products_image_large_additional=' . $products_image_large) . '" target="_blank">' . $thumb_regular . '<br /><span class="imgLinkAdditional">' . TEXT_CLICK_TO_ENLARGE . '</span></a>' : $thumb_regular ) . '</noscript>';

//      $alternate_link = '<a href="' . $products_image_large . '" onclick="javascript:popupWindow(\''. $large_link . '\') return false;" title="' . $products_name . '" target="_blank">' . $thumb_regular . '<br />' . TEXT_CLICK_TO_ENLARGE . '</a>';

$link = $script_link . "\n      " . $noscript_link;
//      $link = $alternate_link;

I presume then that I need to do something with the other two lines at the bottom?

Cheers,
Rick

21 Jun 2012, 11:30 AM
#6
dgent avatar

dgent

Totally Zenned

Join Date:
Nov 2009
Location:
UK
Posts:
1,117
Plugin Contributions:
0

Re: Make additional images NOT clickable

// $alternate_link = '<a href="' . $products_image_large . '" onclick="javascriptopupWindow(\''. $large_link . '\') return false;" title="' . $products_name . '" target="_blank">' . $thumb_regular . '<br />' . TEXT_CLICK_TO_ENLARGE . '</a>';

Replace <a href= with just <a= and see if that works.

21 Jun 2012, 11:41 AM
#7
dgent avatar

dgent

Totally Zenned

Join Date:
Nov 2009
Location:
UK
Posts:
1,117
Plugin Contributions:
0

Re: Make additional images NOT clickable

Personally, you have to think if this is worthwhile.

Remember any one on a mobile phone or tablet, doesnt have 'image hover' - they only have clickable links. So by doing this none of those people will be able to see a large version of your pic, and let alone the hover large version.

21 Jun 2012, 11:59 AM
#8
justrimless avatar

justrimless

Zen Follower

Join Date:
Aug 2006
Posts:
127
Plugin Contributions:
0

Re: Make additional images NOT clickable

dgent:

// $alternate_link = '<a href="' . $products_image_large . '" onclick="javascriptopupWindow(\''. $large_link . '\') return false;" title="' . $products_name . '" target="_blank">' . $thumb_regular . '<br />' . TEXT_CLICK_TO_ENLARGE . '</a>';

Replace <a href= with just <a= and see if that works.

That works a treat, thanks.

Your other points are noted, my actual problem is that when clicking on the additional images the wrong picture loads into the new window, I am after a quick fix while I look into that.

Thanks for your help,
Rick

21 Jun 2012, 5:22 PM
#9
sph avatar

sph

Totally Zenned

Join Date:
Jan 2006
Posts:
1,556
Plugin Contributions:
0

Re: Make additional images NOT clickable

By wrong picture, you mean another photo for that product? Sometimes this happens to me when I change the main photo for an additional photo. It sticks in IH's bmz cache. Is that the problem?

A link or text address to site may help.

21 Jun 2012, 7:13 PM
#10
justrimless avatar

justrimless

Zen Follower

Join Date:
Aug 2006
Posts:
127
Plugin Contributions:
0

Re: Make additional images NOT clickable

When clicking on any of the additional images, the main product image loads in the popup window.

I'm sure it's probably to do with the way the images have been named.

The site is at onestopglasses co uk, but the images are currently unclickable.

21 Jun 2012, 10:02 PM
#11
sph avatar

sph

Totally Zenned

Join Date:
Jan 2006
Posts:
1,556
Plugin Contributions:
0

Re: Make additional images NOT clickable

How are the images named? I cannot tell because of the bmz cache. And why not just re-name them properly, instead of doing all this code?

EDIT: BTW, you have a nice looking site.

21 Jun 2012, 11:17 PM
#12
justrimless avatar

justrimless

Zen Follower

Join Date:
Aug 2006
Posts:
127
Plugin Contributions:
0

Re: Make additional images NOT clickable

SPH:

How are the images named? I cannot tell because of the bmz cache. And why not just re-name them properly, instead of doing all this code?
My missus added a load of products (I normally do it), then noticed the issue with the popup image.
I've had a look and i'm sure she has named the images correctly, the only difference being that I normally FTP them and she added them with image handler in admin. So I don't know what's up.

Plus she will be miffed if she has spent time helping me and it has gone pear shaped.

And there are some other image related addons that i intend to have a look at.

EDIT: BTW, you have a nice looking site.
Many thanks.

5 Apr 2013, 3:14 PM
#13
enisenis avatar

enisenis

New Zenner

Join Date:
Apr 2013
Posts:
1
Plugin Contributions:
0

Re: Make additional images NOT clickable

Thanks dgent your > Replace <a href= with just <a= and see if that works. input really saved me hours of research, many thanks!