Zen Cart Logo
Forums / Templates, Stylesheets, Page Layout / Can I inhibit product hyperlink to lage image?

Can I inhibit product hyperlink to lage image?

Locked

Views: 823

Results 1 to 3 of 3
This thread is locked. New replies are disabled.
10 Aug 2008, 5:13 PM
#1
kiwibrian avatar

kiwibrian

New Zenner

Join Date:
Nov 2003
Posts:
70
Plugin Contributions:
0

Can I inhibit product hyperlink to lage image?

As my Product images are already fullsize, I wish to inhibit the hyperlink facility achieved by clicking on the Product image.
Is this possible?

11 Aug 2008, 9:29 AM
#2
jeremymiller avatar

jeremymiller

Zen Follower

Join Date:
Feb 2005
Location:
Reno, NV
Posts:
116
Plugin Contributions:
0

Re: Can I inhibit product hyperlink to lage image?

Here are some steps to add this to a configuration option in your admin.

Apply this SQL Patch in Tools->Install SQL Patches

#NEXT_X_ROWS_AS_ONE_COMMAND:3
SET @new_sort_order=1;
SELECT MAX(sort_order)+1 INTO @new_sort_order 
FROM configuration 
WHERE configuration_group_id=4;
INSERT INTO configuration 
SET configuration_id = NULL , configuration_title = 'Hide Larger Image Link', configuration_key = 'LARGER_IMAGE_LINK', configuration_value = 'false', configuration_description = 'Hides the link under images in product listing. Must apply the patch described at http://www.zen-cart.com/forum/showthread.php?p=595632 for this to work', configuration_group_id=4, sort_order = @new_sort_order, date_added = NOW( ) , set_function = 'zen_cfg_select_option(array(''true'', ''false''), ';

Then, go to Configuration->Images and scroll to the bottom option, called "Hide Larger Image Link" and set it to "true".

Finally, you will need to apply a patch to the template files. Replace includes/templates/[YOUR TEMPLATE]/templates/tpl_modules_main_product_image.php with this code. For those who have already customized this code block, the changes have been bolded.

<?php
/**
 * Module Template
 *
 * @package templateSystem
 * @copyright Copyright 2003-2005 Zen Cart Development Team
 * @copyright Portions Copyright 2003 osCommerce
 * @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
 * @version $Id: tpl_modules_main_product_image.php 3208 2006-03-19 16:48:57Z birdbrain $
 */
?>
<?php require(DIR_WS_MODULES . zen_get_module_directory(FILENAME_MAIN_PRODUCT_IMAGE)); ?> 
<div id="productMainImage" class="centeredContent back">[b]<?php
if (LARGER_IMAGE_LINK == 'false') {
?>[/b]
<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>
[b]<?php
} else {
  echo zen_image($products_image_medium, $products_name, MEDIUM_IMAGE_WIDTH, MEDIUM_IMAGE_HEIGHT);
}
?>[/b]</div>
11 Aug 2008, 2:39 PM
#3
kiwibrian avatar

kiwibrian

New Zenner

Join Date:
Nov 2003
Posts:
70
Plugin Contributions:
0

Re: Can I inhibit product hyperlink to lage image?

Thankyou very very much for this great mod Jeremy.
I have it installed on my local XAMPP setup and it works superbly.
I am sure that many others will find this to be a great enhancement of the superb Zen Cart application.
Thanks again.