Zen Cart Logo
Forums / Templates, Stylesheets, Page Layout / Set Product Listing Images to link to Image not Product Info

Set Product Listing Images to link to Image not Product Info

Locked

Views: 1,366

Results 1 to 3 of 3
This thread is locked. New replies are disabled.
8 Feb 2010, 12:40 PM
#1
ruts67 avatar

ruts67

New Zenner

Join Date:
Feb 2010
Posts:
15
Plugin Contributions:
0

Set Product Listing Images to link to Image not Product Info

What I am endeavoring to do is have the link on the Product Image in all the listing pages be linked to the image in the same way the image on the info page is.

I am using SlimBox and from the info page I get a large overlayed example of the product image - I want to be able to do this from the listing so customers don't need to go to the info view just to get a bigger image.

I am thinking I need to integrate this code:

<?php require(DIR_WS_MODULES . zen_get_module_directory(FILENAME_MAIN_PRODUCT_IMAGE)); ?> 
<div id="productMainImage" class="centeredContent back">
<?php
  echo '<a href="' . $products_image_large . '" title="' . $products_name . '" rel="lightbox">' . zen_image($products_image_medium, $products_name, MEDIUM_IMAGE_WIDTH, MEDIUM_IMAGE_HEIGHT) . '<br /><span class="imgLink">' . '</span></a>';
?>
</div>

into these sections of code (from Product_Listing.php)

Line #165 : $lc_text = '<a href="' . zen_href_link(zen_get_info_page($listing->fields['products_id']), 'cPath=' . (($_GET['manufacturers_id'] > 0 and $_GET['filter_id']) > 0 ? zen_get_generated_category_path_rev($_GET['filter_id']) : ($_GET['cPath'] > 0 ? zen_get_generated_category_path_rev($_GET['cPath']) : zen_get_generated_category_path_rev($listing->fields['master_categories_id']))) . '&products_id=' . $listing->fields['products_id']) . '">' . zen_image(DIR_WS_IMAGES . $listing->fields['products_image'], $listing->fields['products_name'], IMAGE_PRODUCT_LISTING_WIDTH, IMAGE_PRODUCT_LISTING_HEIGHT, 'class="listingProductImage"') . '</a>';
Line #167 : $lc_text = '<a href="' . zen_href_link(zen_get_info_page($listing->fields['products_id']), 'cPath=' . (($_GET['manufacturers_id'] > 0 and $_GET['filter_id']) > 0 ? zen_get_generated_category_path_rev($_GET['filter_id']) : ($_GET['cPath'] > 0 ? zen_get_generated_category_path_rev($_GET['cPath']) : zen_get_generated_category_path_rev($listing->fields['master_categories_id']))) . '&products_id=' . $listing->fields['products_id']) . '">' . zen_image(DIR_WS_IMAGES . $listing->fields['products_image'], $listing->fields['products_name'], IMAGE_PRODUCT_LISTING_WIDTH, IMAGE_PRODUCT_LISTING_HEIGHT, 'class="listingProductImage"') . '</a>';

Any help would be appreciated - the shop site currently is at http://www.thestickerfamily.com.au/shop/

Thanks,
Scott

8 Feb 2010, 3:10 PM
#2
jasmel avatar

jasmel

Zen Follower

Join Date:
Feb 2008
Location:
Washington State
Posts:
230
Plugin Contributions:
0

Re: Set Product Listing Images to link to Image not Product Info

Ruts67:

What I am endeavoring to do is have the link on the Product Image in all the listing pages be linked to the image in the same way the image on the info page is.

I am using SlimBox and from the info page I get a large overlayed example of the product image - I want to be able to do this from the listing so customers don't need to go to the info view just to get a bigger image.

I am thinking I need to integrate this code:

<?php require(DIR_WS_MODULES . zen_get_module_directory(FILENAME_MAIN_PRODUCT_IMAGE)); ?> <div id="productMainImage" class="centeredContent back"> <?php echo '<a href="' . $products_image_large . '" title="' . $products_name . '" rel="lightbox">' . zen_image($products_image_medium, $products_name, MEDIUM_IMAGE_WIDTH, MEDIUM_IMAGE_HEIGHT) . '<br /><span class="imgLink">' . '</span></a>'; ?> </div> ``` > > into these sections of code (from Product_Listing.php) > ``` Line #165 : $lc_text = '<a href="' . zen_href_link(zen_get_info_page($listing->fields['products_id']), 'cPath=' . (($_GET['manufacturers_id'] > 0 and $_GET['filter_id']) > 0 ? zen_get_generated_category_path_rev($_GET['filter_id']) : ($_GET['cPath'] > 0 ? zen_get_generated_category_path_rev($_GET['cPath']) : zen_get_generated_category_path_rev($listing->fields['master_categories_id']))) . '&products_id=' . $listing->fields['products_id']) . '">' . zen_image(DIR_WS_IMAGES . $listing->fields['products_image'], $listing->fields['products_name'], IMAGE_PRODUCT_LISTING_WIDTH, IMAGE_PRODUCT_LISTING_HEIGHT, 'class="listingProductImage"') . '</a>'; ``` > > ``` Line #167 : $lc_text = '<a href="' . zen_href_link(zen_get_info_page($listing->fields['products_id']), 'cPath=' . (($_GET['manufacturers_id'] > 0 and $_GET['filter_id']) > 0 ? zen_get_generated_category_path_rev($_GET['filter_id']) : ($_GET['cPath'] > 0 ? zen_get_generated_category_path_rev($_GET['cPath']) : zen_get_generated_category_path_rev($listing->fields['master_categories_id']))) . '&products_id=' . $listing->fields['products_id']) . '">' . zen_image(DIR_WS_IMAGES . $listing->fields['products_image'], $listing->fields['products_name'], IMAGE_PRODUCT_LISTING_WIDTH, IMAGE_PRODUCT_LISTING_HEIGHT, 'class="listingProductImage"') . '</a>'; ``` > > Any help would be appreciated - the shop site currently is at <http://www.thestickerfamily.com.au/shop/> > > Thanks, > Scott

I can't help with this question... but I LOVE your site!

13 Feb 2010, 11:35 PM
#3
ruts67 avatar

ruts67

New Zenner

Join Date:
Feb 2010
Posts:
15
Plugin Contributions:
0

Re: Set Product Listing Images to link to Image not Product Info

I have tried to cut and paste a few bits - but I am still struggling to get my head around which bit of code is writing which element - any advice here - I'd really like every image link to open the image as opposed to being the same link as the product title.:blink: