Results 1 to 6 of 6
  1. #1

    Default Images as links in product listings

    Hi again

    Just upgraded our site (www.artos.dk) with a new template and now I cannot remember how we on the old site made the images in the product listings link to the products (like the product name does)?

    Any help appreciated...

  2. #2
    Join Date
    Aug 2014
    Location
    Lisbon
    Posts
    594
    Plugin Contributions
    0

    Default Re: Images as links in product listings

    at \includes\modules\YOUR_TEMPLATE\product_listing.php

    PHP Code:
    case 'PRODUCT_LIST_IMAGE':
            
    $lc_align 'center';
            if (
    $listing->fields['products_image'] == '' and PRODUCTS_IMAGE_NO_IMAGE_STATUS == 0) {
              
    $lc_text '';
            } else {
              if (isset(
    $_GET['manufacturers_id'])) {
                
    $lc_text '<div class="listing-image"><a href="' zen_href_link(zen_get_info_page($listing->fields['products_id']), 'cPath=' . (($_GET['manufacturers_id'] > and $_GET['filter_id']) > ?  zen_get_generated_category_path_rev($_GET['filter_id']) : ($_GET['cPath'] > 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_WIDTHIMAGE_PRODUCT_LISTING_HEIGHT'class="listingProductImage"') . '</a></div>';
              } else {
                
    $lc_text '<div class="listing-image"><a href="' zen_href_link(zen_get_info_page($listing->fields['products_id']), 'cPath=' . (($_GET['manufacturers_id'] > and $_GET['filter_id']) > ?  zen_get_generated_category_path_rev($_GET['filter_id']) : ($_GET['cPath'] > 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_WIDTHIMAGE_PRODUCT_LISTING_HEIGHT'class="listingProductImage"') . '</a></div>';
              }
            }
            break;
          } 
    Note: maybe your file is different , adjust to adapt to your template.
    “Though the problems of the world are increasingly complex, the solutions remain embarrassingly simple.” ― Bill Mollison

  3. #3

    Default Re: Images as links in product listings

    Thanks. It did however not seem to work.
    I replaced this part with your.

    case 'PRODUCT_LIST_IMAGE':
    $lc_align = 'center';
    if ($listing->fields['products_image'] == '' and PRODUCTS_IMAGE_NO_IMAGE_STATUS == 0) {
    $lc_text = '';
    $lst_lc_text = '';
    }else {

    if (!file_exists(DIR_WS_IMAGES . $listing->fields['products_image'])) { $products_listing_image = DIR_WS_IMAGES . "no_picture.gif";}else{$products_listing_image = DIR_WS_IMAGES . $listing->fields['products_image'];}

    if (isset($_GET['manufacturers_id'])) {
    $product_img_link= zen_href_link($zen_get_info_page, 'cPath=' . $cPath . '&products_id=' . $listing->fields['products_id'], 'SSL');
    $product_img = zen_image($products_listing_image, $products_name, IMAGE_PRODUCT_LISTING_WIDTH, IMAGE_PRODUCT_LISTING_HEIGHT);
    }else {
    $product_img = zen_image($products_listing_image, $products_name, IMAGE_PRODUCT_LISTING_WIDTH, IMAGE_PRODUCT_LISTING_HEIGHT);
    }
    }
    break;
    }

  4. #4
    Join Date
    Aug 2014
    Location
    Lisbon
    Posts
    594
    Plugin Contributions
    0

    Default Re: Images as links in product listings

    Not sure how your template is build, but there's a $product_img_link and a $product_img. Probably they are outputting. So try to put the $product_img_link after the else
    PHP Code:
    if (isset($_GET['manufacturers_id'])) {
    $product_img_linkzen_href_link($zen_get_info_page'cPath=' $cPath '&products_id=' $listing->fields['products_id'], 'SSL');
    $product_img zen_image($products_listing_image$products_nameIMAGE_PRODUCT_LISTING_WIDTHIMAGE_PRODUCT_LISTING_HEIGHT);
    }else {
    $product_img_linkzen_href_link($zen_get_info_page'cPath=' $cPath '&products_id=' $listing->fields['products_id'], 'SSL');
    $product_img zen_image($products_listing_image$products_nameIMAGE_PRODUCT_LISTING_WIDTHIMAGE_PRODUCT_LISTING_HEIGHT);

    “Though the problems of the world are increasingly complex, the solutions remain embarrassingly simple.” ― Bill Mollison

  5. #5
    Join Date
    Aug 2014
    Location
    Lisbon
    Posts
    594
    Plugin Contributions
    0

    Default Re: Images as links in product listings

    Didn't realize that your template has a "quick view".
    I guess that's intended to function that way. Do you really need a extra link ?
    If you bought that template, have you check if it has some options on product listings ?


    HTML Code:
    <div class="product-img">
    						<img src="images/5/5051162370611.jpg" alt="Angus Buchan's Ordinary People / The Grace Card / Rust / Faith Like Potatoes" title=" Angus Buchan's Ordinary People / The Grace Card / Rust / Faith Like Potatoes " width="170" height="170">
    						<div class="badges"></div>
    						<div class="product-icon">
    							<ul> 
    								<li><a class="qck-lnk quick-view quickview-action" href="javascript:void(0);" data-toggle="modal" data-target="#quickViewModal" data-target-href="https://www.artos.dk/updated/index.php?main_page=pzen_quickview&amp;products_id=34512" data-placement="top" title="Quick View"><i data-toggle="tooltip" title="" class="pe-7s-search" data-original-title="Quick View"></i><span class="title button hidden btn">Quick View</span></a></li>
    								<li><a class="wishlist-lnk btn-lnk" href="https://www.artos.dk/updated/index.php?main_page=wishlist&amp;products_id=34512&amp;action=wishlist_add_product" data-toggle="tooltip" data-placement="top" title="" data-original-title="Sæt på ønskelisten"><i class="pe-7s-like"></i></a></li>
    								
    							</ul>
    						</div>
    					</div>
    “Though the problems of the world are increasingly complex, the solutions remain embarrassingly simple.” ― Bill Mollison

  6. #6

    Default Re: Images as links in product listings

    It does not have that option, but on the frontpage in product sliders the image actually links.
    I guess it is possible to take the code from the product name (<a href="' . zen_href_link($zen_get_info_page, 'cPath=' . $cPath . '&products_id=' . $listing->fields['products_id'], 'SSL') . '">' . $products_name . '</a>) and copy to the image? But I'm not hardcore in php so any help are appreciated...

 

 

Similar Threads

  1. Movie files as product images or in listings
    By outeredge2 in forum Setting Up Categories, Products, Attributes
    Replies: 6
    Last Post: 3 May 2012, 09:30 PM
  2. Product Listings images boder hover
    By triplexxx in forum Templates, Stylesheets, Page Layout
    Replies: 3
    Last Post: 4 Oct 2010, 07:00 AM
  3. Sorting Product Listings via Links?
    By hgws in forum Templates, Stylesheets, Page Layout
    Replies: 0
    Last Post: 20 Aug 2009, 08:32 PM
  4. product images and listings
    By hottytoddysummer in forum Templates, Stylesheets, Page Layout
    Replies: 7
    Last Post: 25 Mar 2008, 05:24 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg
Zen-Cart, Internet Selling Services, Klamath Falls, OR