Subversion Repositories SmartDukaan

Rev

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

Rev 5373 Rev 5552
Line 144... Line 144...
144
		var productOne = $("#catalog_id").val();
144
		var productOne = $("#catalog_id").val();
145
		var prodDetail = $("#productDetail");
145
		var prodDetail = $("#productDetail");
146
		var productNameOne = $(prodDetail).find("span.brand").html() + " " + $(prodDetail).find("span.product-name").html();  
146
		var productNameOne = $(prodDetail).find("span.brand").html() + " " + $(prodDetail).find("span.product-name").html();  
147
		var hyphenateNameOne = productNameOne.replace(/ +/g, '-').replace(/\/+/g,'-').replace(/-+/g,'-').toLowerCase();  
147
		var hyphenateNameOne = productNameOne.replace(/ +/g, '-').replace(/\/+/g,'-').replace(/-+/g,'-').toLowerCase();  
148
		window.location = "/compare-" + hyphenatedProductType + "/" 
148
		window.location = "/compare-" + hyphenatedProductType + "/" 
149
			+ hyphenateNameOne + "-vs-" + hypenatedNameTwo + "?p1="+productOne+"&p2="+productTwo;	
149
			+ hyphenateNameOne + "-vs-" + hypenatedNameTwo + "?p1="+productOne+"&p2="+productTwo+"&fromsrc=product_page";	
150
	}
150
	}
151
    
151
    
152
    $("#accessories table td div a").live('click', function() {
152
    $("#accessories table td div a").live('click', function() {
153
    	var productId = $(this).parent().parent().parent().children().find('input[type=checkbox]').val();
153
    	var productId = $(this).parent().parent().parent().children().find('input[type=checkbox]').val();
154
    	trackEventWithGA('Widget', 'Accessory Click', productId);
154
    	trackEventWithGA('Widget', 'Accessory Click', productId);
155
    });
155
    });
156
    
156
    
-
 
157
    $('a.compare-now').live('click', function(){
-
 
158
		var productType = $(this).attr('producttype');
-
 
159
		productType = productType.replace(/ +/g, '-').toLowerCase();
-
 
160
		
-
 
161
		var productOne = $("#catalog_id").val();
-
 
162
		var prodDetail = $("#productDetail");
-
 
163
		var productNameOne = $(prodDetail).find("span.brand").html() + " " + $(prodDetail).find("span.product-name").html();
-
 
164
		var hyphenateNameOne = productNameOne.replace(/ +/g, '-').replace(/\/+/g,'-').replace(/-+/g,'-').toLowerCase();
-
 
165
		
-
 
166
		var productTwo = $(this).attr("value");
-
 
167
		var hypenatedNameTwo = $(this).attr("title").replace(/ +/g, '-').replace(/\/+/g,'-').replace(/-+/g,'-').toLowerCase();
-
 
168
		
-
 
169
		window.location = "/compare-" + productType + "/" + hyphenateNameOne + "-vs-" + hypenatedNameTwo + "?p1="+productOne+"&p2="+productTwo+"&fromsrc=most_compared_widget";
-
 
170
    });
-
 
171
    
157
});
172
});
158
 
173
 
159
function changeSignInClass(){
174
function changeSignInClass(){
160
	if(document.getElementById("signinClass").className.indexOf("signin1") > -1)	{
175
	if(document.getElementById("signinClass").className.indexOf("signin1") > -1)	{
161
		document.getElementById("signinClass").className = 'signin';
176
		document.getElementById("signinClass").className = 'signin';
Line 205... Line 220...
205
		success : function(html) {
220
		success : function(html) {
206
   		    $("#mostcompared").html(html);
221
   		    $("#mostcompared").html(html);
207
 
222
 
208
		    // Product Title
223
		    // Product Title
209
		    $("#mostcompared table td div a").each(function() {
224
		    $("#mostcompared table td div a").each(function() {
-
 
225
		    		if($(this).attr('class') != "compare-now"){
210
					$(this).truncate({addtitle : true});
226
		    			$(this).truncate({addtitle : true});
-
 
227
		    		}
211
		    });
228
		    });
212
 
229
 
213
		    // Product Price
230
		    // Product Price
214
		    $("#mostcompared table td div div.price").each(function() {
231
		    $("#mostcompared table td div div.price").each(function() {
215
					$(this).truncate({addtitle : true});
232
					$(this).truncate({addtitle : true});