Subversion Repositories SmartDukaan

Rev

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

Rev 7872 Rev 7873
Line 280... Line 280...
280
			var response = eval('(' + msg + ')');
280
			var response = eval('(' + msg + ')');
281
			var deliveryEstimate = response['delivery_estimate'];
281
			var deliveryEstimate = response['delivery_estimate'];
282
			var codDeliveryEstimate = response['cod_delivery_estimate'];
282
			var codDeliveryEstimate = response['cod_delivery_estimate'];
283
			var isCODAvailableForLocation = (response['is_cod_available_for_location'] === 'true');
283
			var isCODAvailableForLocation = (response['is_cod_available_for_location'] === 'true');
284
			var isOTG = (response['on_time_guarantee'] === 'true');
284
			var isOTG = (response['on_time_guarantee'] === 'true');
285
			var systemDate = response['system_date'];
285
			var businessDays = response['business_days'];
286
			
286
			
287
			if(deliveryEstimate == -1)	{
287
			if(deliveryEstimate == -1)	{
288
				$("#shipping_time").hide();
288
				$("#shipping_time").hide();
289
				$("#shipping_time_1").show();
289
				$("#shipping_time_1").show();
290
				$('#cod_know_more').hide();
290
				$('#cod_know_more').hide();
291
			} else	{
291
			} else	{
292
				toDate = new Date(systemDate);
292
				$('#cod_know_more').hide();
293
				myDate = new Date(deliveryEstimate);
-
 
294
				days = (myDate-toDate)/86400000;
-
 
295
				if($("#shipping_time").html().indexOf('after arrival')>-1){
293
				if($("#shipping_time").html().indexOf('after arrival')>-1){
296
					$("#shipping_time .red").html(days + " Days");
294
					$("#shipping_time .red").html(businessDays + " Days");
297
					$('#cod_know_more').hide();
-
 
298
				}else{
295
				}else{
299
					if(isCODAvailableForLocation){
296
					if(isCODAvailableForLocation && (codDeliveryEstimate == deliveryEstimate)){
300
						codDate = new Date(codDeliveryEstimate);
-
 
301
						coddays = (codDate-myDate)/86400000;
-
 
302
						if(coddays > 0){
-
 
303
							$('#cod_know_more').show();
-
 
304
							$("#shipping_time .cod").html("Cash On Delivery orders is " + codDeliveryEstimate);
297
						$("#shipping_time .cod").html("Cash On Delivery orders is " + codDeliveryEstimate);
305
						}
-
 
306
					}else{
-
 
307
						$('#cod_know_more').hide();
298
						$('#cod_know_more').show();
308
					}
-
 
309
					if(days == 1){
-
 
310
						$("#shipping_time .red").html("Tomorrow, " + deliveryEstimate);
-
 
311
					}else{
-
 
312
						$("#shipping_time .red").html(deliveryEstimate);
-
 
313
					}
299
					}
-
 
300
					$("#shipping_time .red").html(deliveryEstimate);
314
				}
301
				}
315
			}
302
			}
316
			
303
			
317
			if (isCODAvailableForLocation)	{
304
			if (isCODAvailableForLocation)	{
318
				$('#cod').show();
305
				$('#cod').show();