Subversion Repositories SmartDukaan

Rev

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

Rev 7865 Rev 7872
Line 498... Line 498...
498
			success: function(data){
498
			success: function(data){
499
				$("#img" + "_" + item_id).html("<img src='/images/loader_l.gif'>").hide();
499
				$("#img" + "_" + item_id).html("<img src='/images/loader_l.gif'>").hide();
500
				var response = eval('(' + data + ')');
500
				var response = eval('(' + data + ')');
501
				var deliveryEstimate = response['delivery_estimate'];
501
				var deliveryEstimate = response['delivery_estimate'];
502
				var otg= response['on_time_guarantee'];
502
				var otg= response['on_time_guarantee'];
503
				var codDeliveryEstimate = "Cash On Delivery service is not available for pincode " + $('#zipcode').val();;
503
				var codDeliveryEstimate = response['cod_delivery_estimate'];
504
				var isCODAvailableForLocation = (response['is_cod_available_for_location'] === 'true');
504
				var isCODAvailableForLocation = (response['is_cod_available_for_location'] === 'true');
505
				if(isCODAvailableForLocation){
-
 
506
					codDeliveryEstimate = "Expected Delivery date for Cash On Delivery orders is " + response['cod_delivery_estimate'];
-
 
507
				}
-
 
508
				
505
				
509
				if(deliveryEstimate == -1)	{
506
				if(deliveryEstimate == -1)	{
510
					$("#serv_" + item_id).show();
507
					$("#serv_" + item_id).show();
511
					return;
508
					return;
512
					
-
 
513
				} else	{
509
				} else	{
-
 
510
					var systemDate = response['system_date'];
-
 
511
					toDate = new Date(systemDate);
-
 
512
					myDate = new Date(deliveryEstimate);
-
 
513
					days = (myDate-toDate)/86400000;
514
					$("#days_" + item_id).html(deliveryEstimate);
514
					$("#days_" + item_id).html(deliveryEstimate);
-
 
515
					if(days == 1){
-
 
516
						$("#days_" + item_id).html("Tomorrow, " +  deliveryEstimate);
-
 
517
					}
-
 
518
					$("coddays_" + item_id).hide();
-
 
519
					if(isCODAvailableForLocation && (deliveryEstimate == codDeliveryEstimate)){
-
 
520
						codDeliveryEstimate = "Cash On Delivery orders is ";
515
					$("#coddays_" + item_id).html(codDeliveryEstimate);
521
						$("#coddays_" + item_id).html(codDeliveryEstimate);
-
 
522
						$("coddays_" + item_id).show();	
-
 
523
					}	
516
				}
524
				}
517
				if(otg == "true")	{
525
				if(otg == "true")	{
518
					$("#otg_" + item_id).show();
526
					$("#otg_" + item_id).show();
519
				} else {
527
				} else {
520
					$("#otg_" + item_id).hide();
528
					$("#otg_" + item_id).hide();