Subversion Repositories SmartDukaan

Rev

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

Rev 7744 Rev 7791
Line 200... Line 200...
200
		type: "GET",
200
		type: "GET",
201
		url: "/estimate/" + $("#zipcode").val() + "_" + itemId,
201
		url: "/estimate/" + $("#zipcode").val() + "_" + itemId,
202
		beforeSend: function()	{
202
		beforeSend: function()	{
203
			$("#shipping_time").show();
203
			$("#shipping_time").show();
204
			$("#shipping_time_1").hide();
204
			$("#shipping_time_1").hide();
205
			$("#shipping_time .red").html("<img src='/images/loader_l.gif'> business days");
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 = parseInt(response['delivery_estimate']);
209
			var deliveryEstimate = parseInt(response['delivery_estimate']);
210
			var isCODAvailableForLocation = (response['is_cod_available_for_location'] === 'true');
210
			var isCODAvailableForLocation = (response['is_cod_available_for_location'] === 'true');
Line 212... Line 212...
212
			
212
			
213
			if(deliveryEstimate == -1)	{
213
			if(deliveryEstimate == -1)	{
214
				$("#shipping_time").hide();
214
				$("#shipping_time").hide();
215
				$("#shipping_time_1").show();
215
				$("#shipping_time_1").show();
216
			} else	{
216
			} else	{
-
 
217
				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));
217
				$("#shipping_time .red").html(deliveryEstimate + ' Business Days');
221
					$("#shipping_time .red").html(days + " Business Days");
-
 
222
				}else{
-
 
223
					$("#shipping_time .red").html(deliveryEstimate);
-
 
224
				}
218
			}
225
			}
219
			
226
			
220
			if (isCODAvailableForLocation)	{
227
			if (isCODAvailableForLocation)	{
221
				$('#cod').show();
228
				$('#cod').show();
222
			} else {
229
			} else {