Subversion Repositories SmartDukaan

Rev

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

Rev 7793 Rev 7809
Line 205... Line 205...
205
			$("#shipping_time .red").html("<img src='/images/loader_l.gif'>");
205
			$("#shipping_time .red").html("<img src='/images/loader_l.gif'>");
206
		},
206
		},
207
		success: function(msg)	{
207
		success: function(msg)	{
208
			var response = eval('(' + msg + ')');
208
			var response = eval('(' + msg + ')');
209
			var deliveryEstimate = response['delivery_estimate'];
209
			var deliveryEstimate = response['delivery_estimate'];
-
 
210
			var codDeliveryEstimate = response['cod_delivery_estimate'];
210
			var isCODAvailableForLocation = (response['is_cod_available_for_location'] === 'true');
211
			var isCODAvailableForLocation = (response['is_cod_available_for_location'] === 'true');
211
			var isOTG = (response['on_time_guarantee'] === 'true');
212
			var isOTG = (response['on_time_guarantee'] === 'true');
-
 
213
			var systemDate = response['system_date'];
212
			
214
			
213
			if(deliveryEstimate == -1)	{
215
			if(deliveryEstimate == -1)	{
214
				$("#shipping_time").hide();
216
				$("#shipping_time").hide();
215
				$("#shipping_time_1").show();
217
				$("#shipping_time_1").show();
216
			} else	{
218
			} else	{
-
 
219
				toDate = new Date(systemDate);
-
 
220
				myDate = new Date(deliveryEstimate);
-
 
221
				days = myDate.getDate() - toDate.getDate();
217
				if($("#shipping_time").html().indexOf('after arrival')>-1){
222
				if($("#shipping_time").html().indexOf('after arrival')>-1){
218
					myDate = new Date(deliveryEstimate);
-
 
219
					toDate = new Date();
-
 
220
					days = parseInt((myDate - toDate) / (1000 * 60 * 60 * 24));
-
 
221
					$("#shipping_time .red").html(days + " Business Days");
223
					$("#shipping_time .red").html(days + " Days");
222
				}else{
224
				}else{
-
 
225
					if(isCODAvailableForLocation){
-
 
226
						codDate = new Date(codDeliveryEstimate);
-
 
227
						coddays = codDate.getDate() - myDate.getDate();
-
 
228
						if(days > 1){
-
 
229
							$('#cod_know_more').show();
-
 
230
							$("#shipping_time .cod").html(codDeliveryEstimate);
-
 
231
						}
-
 
232
					}
-
 
233
					if(days == 1){
-
 
234
						$("#shipping_time .red").html("Tomorrow, " + deliveryEstimate);
-
 
235
					}else{
223
					$("#shipping_time .red").html(deliveryEstimate);
236
						$("#shipping_time .red").html(deliveryEstimate);
-
 
237
					}
224
				}
238
				}
225
			}
239
			}
226
			
240
			
227
			if (isCODAvailableForLocation)	{
241
			if (isCODAvailableForLocation)	{
228
				$('#cod').show();
242
				$('#cod').show();