Subversion Repositories SmartDukaan

Rev

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

Rev 5145 Rev 5322
Line 84... Line 84...
84
		updateCompareCount();
84
		updateCompareCount();
85
	});
85
	});
86
	
86
	
87
	$("#research_compare").live('click', function(){
87
	$("#research_compare").live('click', function(){
88
		var seldata = "";
88
		var seldata = "";
-
 
89
		var prodnames = "";
89
		var tot = 1;
90
		var tot = 1;
90
		var saprt = "";
91
		var saprt = "";
91
		var par = $('#myresearch').find('input[type=checkbox]:checked');
92
		var par = $('#myresearch').find('input[type=checkbox]:checked');
92
		var haveSameProductType = true;
93
		var haveSameProductType = true;
93
		var productType = null;
94
		var productType = null;
Line 98... Line 99...
98
				haveSameProductType = false;
99
				haveSameProductType = false;
99
			}
100
			}
100
			productType = $(this).attr('producttype');
101
			productType = $(this).attr('producttype');
101
			
102
			
102
			if(tot == 1)	{
103
			if(tot == 1)	{
-
 
104
				prodnames += $(this).attr("title").replace(/ +/g, '-').toLowerCase();
103
				seldata += "p" + tot + "=" + $(this).val();
105
				seldata += "p" + tot + "=" + $(this).val();
104
			} else	{
106
			} else	{
105
				seldata += "&p" + tot + "=" + $(this).val();
107
				seldata += "&p" + tot + "=" + $(this).val();
-
 
108
				prodnames += "-vs-" + $(this).attr("title").replace(/ +/g, '-').toLowerCase();
106
			}
109
			}
107
			tot ++;
110
			tot ++;
108
		});
111
		});
109
		
112
		
110
		if(! haveSameProductType)	{
113
		if(! haveSameProductType)	{
111
			alert("Only products of same category can be compared");
114
			alert("Only products of same category can be compared");
112
		} else if(tot > 6)	{
115
		} else if(tot > 6)	{
113
			alert("Can compare upto five products only.");
116
			alert("Can compare upto five products only.");
114
		} else if(tot > 2)	{
117
		} else if(tot > 2)	{
115
			window.location = "/compare-mobile-phones?" + seldata;
118
			window.location = "/compare-mobile-phones/" + prodnames + "?" + seldata;
116
		} else	{
119
		} else	{
117
			alert("Please select atleast two products");
120
			alert("Please select atleast two products");
118
		}
121
		}
119
	});
122
	});
120
	
123