Site maintenance: Sun 15 Nov, from 20:00 UTC, about 4–6 hours. Details

This cutover relies on some testing that is still incomplete so may be cancelled at short notice

Forums / General Questions / Make entire product listing box a link to product info

Make entire product listing box a link to product info

Started by longstockings on 23 Oct 2013, 1:20 PM · Views: 759

Results 1 to 2 of 2
23 Oct 2013, 1:20 PM
#1
longstockings avatar

longstockings

Zen Follower

Join Date:
Jul 2004
Posts:
198
Plugin Contributions:
0

Make entire product listing box a link to product info

Hi

I'm trying to make the div container around the products link through to the product info page. I think the best way is to use javascript but the code I have tried does not appear to work. http://css-tricks.com/snippets/jquery/make-entire-div-clickable/

I've tried playing around with /includes/modules/specials_index.php without success. Some help with this would really be appreciated.

Attachment 13232

UK based Zen Cart Web Designer here https://www.handcoded.co.uk

23 Oct 2013, 6:52 PM
#2
longstockings avatar

longstockings

Zen Follower

Join Date:
Jul 2004
Posts:
198
Plugin Contributions:
0

Re: Make entire product listing box a link to product info

So to do this you have to create a new javascript file in your templates jscript folder named jscript_WHATEVER.js

In this file paste this code

$(document).ready(function(){
$(".centerBoxContentsSpecials.centeredContent a").click(function(e){
e.stopPropagation();
});
$(".centerBoxContentsSpecials.centeredContent").click(function(){
document.location=$(this).find('a:first').attr('href');
});

$(".centerBoxContentsNew.centeredContent a").click(function(e){		e.stopPropagation();	});	
$(".centerBoxContentsNew.centeredContent").click(function(){		document.location=$(this).find('a:first').attr('href');	});				

$(".centerBoxContentsFeatured.centeredContent a").click(function(e){		e.stopPropagation();	});	
$(".centerBoxContentsFeatured.centeredContent").click(function(){		document.location=$(this).find('a:first').attr('href');	});						
$(".categoryListBoxContents a").click(function(e){		e.stopPropagation();	});	
$(".categoryListBoxContents").click(function(){		document.location=$(this).find('a:first').attr('href');	});			

});

That's it

UK based Zen Cart Web Designer here https://www.handcoded.co.uk