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...
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...
at \includes\modules\YOUR_TEMPLATE\product_listing.php
Note: maybe your file is different , adjust to adapt to your template.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'] > 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></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'] > 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></div>';
}
}
break;
}
“Though the problems of the world are increasingly complex, the solutions remain embarrassingly simple.” ― Bill Mollison
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;
}
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_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_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);
}
“Though the problems of the world are increasingly complex, the solutions remain embarrassingly simple.” ― Bill Mollison
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&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&products_id=34512&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
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...
Bookmarks