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 4934
Line 23... Line 23...
23
	}
23
	}
24
}
24
}
25
 
25
 
26
$(function() {
26
$(function() {
27
	  $('.add-to-cart-icon').live('click', function() {
27
	  $('.add-to-cart-icon').live('click', function() {
-
 
28
		clickedCatalogItem=$(this).closest('div.productDetails').find('a').html();
28
	    var items = this.id;
29
	    var items = this.id;
29
	    var itemsarray = items.split('-');
30
	    var itemsarray = items.split('-');
30
	    addToCart(itemsarray[1], itemsarray[0]);
31
	    addToCart(itemsarray[1], itemsarray[0]);
31
	    trackEventWithGA('Home Page', 'Add to Cart Click', '');
32
	    trackEventWithGA('Home Page', 'Add to Cart Click', '');
32
	    return false;
33
	    return false;
Line 41... Line 42...
41
	  $('.best-sellers .title a, .best-sellers .productImg a').click(function(){
42
	  $('.best-sellers .title a, .best-sellers .productImg a').click(function(){
42
		  trackEventWithGA('Home Page', 'Product Link Click', 'Best Sellers');
43
		  trackEventWithGA('Home Page', 'Product Link Click', 'Best Sellers');
43
	  });
44
	  });
44
	
45
	
45
	$("a.addtocart").live('click', function() {
46
	$("a.addtocart").live('click', function() {
-
 
47
		clickedCatalogItem=$(this).closest('div.productDetails').find('a').html();
46
		var catalogid = $(this).attr('catalogid');
48
		var catalogid = $(this).attr('catalogid');
47
 
49
		
48
		var radBtn = "";
50
		var radBtn = "";
49
		var param = "PARAMETERS_" + catalogid;
51
		var param = "PARAMETERS_" + catalogid;
50
		radBtn += '<input type="hidden" id="selected_catalog_id" value=' + catalogid + ' />';
52
		radBtn += '<input type="hidden" id="selected_catalog_id" value=' + catalogid + ' />';
51
		$.each(eval(param), function(val, text) {
53
		$.each(eval(param), function(val, text) {
52
			radBtn += '<label><input type="radio" name="radColorSel" value="' + val + '" /> <span>' + text + '</span></label>';
54
			radBtn += '<label><input type="radio" name="radColorSel" value="' + val + '" /> <span>' + text + '</span></label>';
Line 147... Line 149...
147
    		 data: "productid=" + seldata,
149
    		 data: "productid=" + seldata,
148
    		 success: function(msg){
150
    		 success: function(msg){
149
    			 if(msg==""){
151
    			 if(msg==""){
150
    				 window.location = "/cart";
152
    				 window.location = "/cart";
151
    			 }else{
153
    			 }else{
152
    				 $productDetail =  $("#productDetail");
-
 
153
    				 prodInfo = $productDetail.find("span.brand").html() + $productDetail.find("span.product-name");
-
 
154
    				 trackEventWithGA('Order', 'OOS Lightbox', prodInfo);
154
    				 trackEventWithGA('Order', 'OOS Lightbox', clickedCatalogItem);
155
    				 displayRelatedProducts(msg);
155
    				 displayRelatedProducts(msg);
156
    			 }
156
    			 }
157
    		 }
157
    		 }
158
    	 });
158
    	 });
159
     } else	{
159
     } else	{