Forums / Templates, Stylesheets, Page Layout / Remove "larger image" link

Remove "larger image" link

Locked

Views: 2,316

Results 1 to 9 of 9
This thread is locked. New replies are disabled.
13 Sep 2009, 2:20 AM
#1
lurch avatar

lurch

New Zenner

Join Date:
Sep 2009
Posts:
4
Plugin Contributions:
0

Remove "larger image" link

How does one remove the "larger image" link in the product description page?

My images are embedded in the html (with my configuration it is much easier this way) so the larger image link is unnecessary and doesn't show a larger image just a thumbnail.
Example:
http://www.jambeta.com/store/index.php?main_page=product_info&cPath=0&products_id=423

Any pointers would be very much appreciated.

13 Sep 2009, 8:54 AM
#2
niccol avatar

niccol

Totally Zenned

Join Date:
Apr 2009
Posts:
2,138
Plugin Contributions:
1

Re: Remove "larger image" link

Well you can get rid of the text from a language file which you have obviously discovered.

Tho get rid of the link entirely find a file called (includes/templates/yourtemplate/templatees) tpl_main_product_image. Find

<div id="productMainImage" class="centeredContent back">
<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>'; ?>');
//--></script>
<noscript>
<?php
  echo '<a href="' . zen_href_link(FILENAME_POPUP_IMAGE, 'pID=' . $_GET['products_id']) . '" target="_blank">' . zen_image($products_image_medium, $products_name, MEDIUM_IMAGE_WIDTH, MEDIUM_IMAGE_HEIGHT) . '<br /><span class="imgLink">' . TEXT_CLICK_TO_ENLARGE . '</span></a>';
?>
</noscript>
</div>

Change it to:

<div id="productMainImage" class="centeredContent back">
<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) . '</a>'; ?>');
//--></script>
<noscript>
<?php
  echo '<a href="' . zen_href_link(FILENAME_POPUP_IMAGE, 'pID=' . $_GET['products_id']) . '" target="_blank">' . zen_image($products_image_medium, $products_name, MEDIUM_IMAGE_WIDTH, MEDIUM_IMAGE_HEIGHT) . '</a>';
?>
</noscript>
</div>

Nick
iszent.com

14 Sep 2009, 5:49 PM
#3
jeffmcnear avatar

jeffmcnear

New Zenner

Join Date:
Nov 2008
Posts:
5
Plugin Contributions:
0

Re: Remove "larger image" link

What about the case when this particular file doesn't exist in a particular template (in my case "clean business")?
Changing the file you reference in the default template doesn't seem to have any effect.

14 Sep 2009, 7:05 PM
#4
niccol avatar

niccol

Totally Zenned

Join Date:
Apr 2009
Posts:
2,138
Plugin Contributions:
1

Re: Remove "larger image" link

Firstly, if you have a template other than the default template that is being used and you want to change a file that is in the default but not in your own template you should:

  • copy the default version to the same place in your template
  • edit the copied version.

Next, sorry I may have misunderstood what you are trying to do. Are you trying to get rid of the link which usually reads ' larger limage' and sits underneath the main image. Or are you trying to get rid of the functionality of clicking on the image to get a pop-up?

If it is the first then my previous post covered it.

If it is the second ( i.e. you want the image just to be an image rather than a link to a larger image ) then......

Find the same bit of code:

<div id="productMainImage" class="centeredContent back">
<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) . '</a>'; ?>');
//--></script>
<noscript>
<?php
  echo '<a href="' . zen_href_link(FILENAME_POPUP_IMAGE, 'pID=' . $_GET['products_id']) . '" target="_blank">' . zen_image($products_image_medium, $products_name, MEDIUM_IMAGE_WIDTH, MEDIUM_IMAGE_HEIGHT) . '</a>';
?>
</noscript>
</div>

And change it to:

<div id="productMainImage" class="centeredContent back">
<?php echo zen_image($products_image_medium, addslashes($products_name), MEDIUM_IMAGE_WIDTH, MEDIUM_IMAGE_HEIGHT);?>
</div>

Nick
iszent.com

14 Sep 2009, 7:53 PM
#5
jeffmcnear avatar

jeffmcnear

New Zenner

Join Date:
Nov 2008
Posts:
5
Plugin Contributions:
0

Re: Remove "larger image" link

Thanks much for your quick response.... Sorry but I'm still a bit lost...
I'm finding this file under the default template:
includes/templates/template_default/templates/tpl_modules_main_product_image.php

but not:
includes/templates/template_default/templates/tpl_main_product_image.php

Is this the file I need to copy over and then edit iside of the template I'm using?

14 Sep 2009, 8:05 PM
#6
jeffmcnear avatar

jeffmcnear

New Zenner

Join Date:
Nov 2008
Posts:
5
Plugin Contributions:
0

Re: Remove "larger image" link

To answer my own question, yes!!!

This has solved my problem, and i greatly appreciate your help!!!

14 Sep 2009, 8:07 PM
#7
niccol avatar

niccol

Totally Zenned

Join Date:
Apr 2009
Posts:
2,138
Plugin Contributions:
1

Re: Remove "larger image" link

Yes, this is the override system at work :smile:

What it means is that you never edit the files in the default template. This has all kinds of advantages:

  • you always keep the default template functional
  • you always can refer to the files in the default template as a reference
  • your alterations won't be overwritten by an upgrade of zen cart
  • and more...

So, yes you need to copy:

includes/templates/template_default/templates/tpl_modules_main_product_image.php

to:

includes/templates/yourtemplate/templates/tpl_modules_main_product_image.php

You need to replace where I have written 'yourtemplate' with the name of you own template!

Then you will have one version of this file in the default template and one version of it in yourtemplate. Zen Cart will choose which one to use based on which template you are using.

This means that you can edit the version knowing that you can only mess up that template and if the worse comes to the worse you can revert to the default template that you haven't fiddled with. It won't come to that though :smile:

Nick
iszent.com

15 Sep 2009, 11:30 PM
#8
lurch avatar

lurch

New Zenner

Join Date:
Sep 2009
Posts:
4
Plugin Contributions:
0

Re: Remove "larger image" link

I've got it like I want it now.
Thanks for the assist niccol!

18 May 2010, 9:46 AM
#9
sirluck avatar

sirluck

New Zenner

Join Date:
Oct 2007
Posts:
32
Plugin Contributions:
0

Re: Remove "larger image" link

That file is now called tpl_modules_main_product_image.php as of 1.3.9b and it still works, thanks!