Subversion Repositories SmartDukaan

Rev

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

Rev 10817 Rev 10953
Line 120... Line 120...
120
	    theft = parseInt(theft);
120
	    theft = parseInt(theft);
121
	    var total = document.getElementById('total').innerHTML;
121
	    var total = document.getElementById('total').innerHTML;
122
	    total = parseInt(total);
122
	    total = parseInt(total);
123
	    if(insure == true){
123
	    if(insure == true){
124
	    	insuredItems.push(itemId);
124
	    	insuredItems.push(itemId);
-
 
125
	    	if(typeof _gaq != "undefined" && _gaq != null)	{
125
	    	ga('send', 'event', 'Insurance', 'Want Insurance',itemId);
126
				_gaq.push(['_trackEvent', 'insurance', 'Want Insurance',itemId]);
-
 
127
			}
126
	    	if(document.getElementById('discountPrice').style.display == 'block'){
128
	    	if(document.getElementById('discountPrice').style.display == 'block'){
127
	    		var discountPrice = document.getElementById('discountedPrice').innerHTML;
129
	    		var discountPrice = document.getElementById('discountedPrice').innerHTML;
128
	    		discountPrice = parseInt(discountPrice);
130
	    		discountPrice = parseInt(discountPrice);
129
	    		document.getElementById('discountedPrice').innerHTML = discountPrice+theft;
131
	    		document.getElementById('discountedPrice').innerHTML = discountPrice+theft;
130
	    	}
132
	    	}
Line 185... Line 187...
185
			document.getElementById(tc).style.display = 'block';
187
			document.getElementById(tc).style.display = 'block';
186
		}
188
		}
187
	}
189
	}
188
	else if(insure == true && tncChkd == true){
190
	else if(insure == true && tncChkd == true){
189
		debugger;
191
		debugger;
-
 
192
	if(typeof _gaq != "undefined" && _gaq != null)	{
190
	ga('send', 'event', 'Insurance', 'Agreed to Terms',itemId);
193
		_gaq.push(['_trackEvent', 'Insurance', 'Agreed to Terms',itemId]);
-
 
194
	}
191
	var url = base_url+'cart/insure/'+itemId+'/'+insure+'/1';
195
	var url = base_url+'cart/insure/'+itemId+'/'+insure+'/1';
192
	    microAjax(url, function (res) {
196
	    microAjax(url, function (res) {
193
	    	debugger;
197
	    	debugger;
194
	    	var data = JSON.parse(res);
198
	    	var data = JSON.parse(res);
195
	    	data = data.status;
199
	    	data = data.status;
Line 261... Line 265...
261
  	for (var i=0; i<chx.length; i++) {
265
  	for (var i=0; i<chx.length; i++) {
262
    	if (chx[i].type == 'checkbox' && chx[i].checked) {
266
    	if (chx[i].type == 'checkbox' && chx[i].checked) {
263
 		 	var id = chx[i].getAttribute('data-value');
267
 		 	var id = chx[i].getAttribute('data-value');
264
 		 	var tnc = id+'tnc';
268
 		 	var tnc = id+'tnc';
265
 		 	if(document.getElementById(tnc).checked == false){
269
 		 	if(document.getElementById(tnc).checked == false){
-
 
270
 		 		if(typeof _gaq != "undefined" && _gaq != null)	{
266
 		 		ga('send', 'event', 'Insurance', 'Alert for tnc');
271
					_gaq.push(['_trackEvent', 'Insurance', 'Alert for tnc']);
-
 
272
				}
267
 		 		document.getElementById('error').style.display = "block";
273
 		 		document.getElementById('error').style.display = "block";
268
          		document.getElementById('error').innerHTML ='Please agree to the terms and conditions to get insurance';
274
          		document.getElementById('error').innerHTML ='Please agree to the terms and conditions to get insurance';
269
          		window.scrollTo(0,0);
275
          		window.scrollTo(0,0);
270
          		return false;
276
          		return false;
271
 		 		break;
277
 		 		break;
272
 		 	}   
278
 		 	}   
273
    	}
279
    	}
274
	}
280
	}
275
	if(locationServicable == false){
281
	if(locationServicable == false){
276
		var pincode = document.getElementById('pincode').value;
282
		var pincode = document.getElementById('pincode').value;
-
 
283
		if(typeof _gaq != "undefined" && _gaq != null)	{
277
		ga('send', 'event', 'Cart', 'Location not serviceable',pincode);
284
			_gaq.push(['_trackEvent', 'Cart', 'Location not serviceable',pincode]);
-
 
285
		}
278
	}
286
	}
279
	window.location.href = base_url+'shipping';
287
	window.location.href = base_url+'shipping';
280
}
288
}
281
var j=0;
289
var j=0;
282
var locationServicable;
290
var locationServicable;