Subversion Repositories SmartDukaan

Rev

Rev 4922 | Rev 4984 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 4922 Rev 4926
Line 57... Line 57...
57
	$("#research_compare").live('click', function(){
57
	$("#research_compare").live('click', function(){
58
		var seldata = "";
58
		var seldata = "";
59
		var tot = 1;
59
		var tot = 1;
60
		var saprt = "";
60
		var saprt = "";
61
		var par = $('#myresearch').find('input[type=checkbox]:checked');
61
		var par = $('#myresearch').find('input[type=checkbox]:checked');
-
 
62
		var haveSameProductType = true;
-
 
63
		var productType = null;
62
 
64
		
63
		$(par).each(function(){
65
		$(par).each(function(){
-
 
66
			
-
 
67
			if(productType != null && productType != $(this).attr('producttype'))	{
-
 
68
				haveSameProductType = false;
-
 
69
			}
-
 
70
			productType = $(this).attr('producttype');
-
 
71
			
64
			if(tot == 1)	{
72
			if(tot == 1)	{
65
				seldata += "p" + tot + "=" + $(this).val();
73
				seldata += "p" + tot + "=" + $(this).val();
66
			} else	{
74
			} else	{
67
				seldata += "&p" + tot + "=" + $(this).val();
75
				seldata += "&p" + tot + "=" + $(this).val();
68
			}
76
			}
69
			tot ++;
77
			tot ++;
70
		});
78
		});
71
 
79
 
-
 
80
		if(! haveSameProductType)	{
-
 
81
			alert("Only products of same category can be compared");
72
		if(tot > 6)	{
82
		} else if(tot > 6)	{
73
			alert("Can compare upto five products only.");
83
			alert("Can compare upto five products only.");
74
		} else if(tot > 2)	{
84
		} else if(tot > 2)	{
75
			window.location = "/compare-mobile-phones?" + seldata;
85
			window.location = "/compare-mobile-phones?" + seldata;
76
		} else	{
86
		} else	{
77
			alert("Please select atleast two products");
87
			alert("Please select atleast two products");