Subversion Repositories SmartDukaan

Rev

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

Rev 5166 Rev 5234
Line 161... Line 161...
161
	
161
	
162
	jQuery.ajax({
162
	jQuery.ajax({
163
		type: "GET",
163
		type: "GET",
164
		url: "/estimate/" + $("#zipcode").val() + "_" + itemId,
164
		url: "/estimate/" + $("#zipcode").val() + "_" + itemId,
165
		beforeSend: function()	{
165
		beforeSend: function()	{
-
 
166
			$("#shipping_time").show();
-
 
167
			$("#shipping_time_1").hide();
166
			$("#shipping_time").html("Receive in <img src='/images/loader_l.gif'> business days");
168
			$("#shipping_time .red").html("<img src='/images/loader_l.gif'> business days");
167
		},
169
		},
168
		success: function(msg)	{
170
		success: function(msg)	{
169
			var response = eval('(' + msg + ')');
171
			var response = eval('(' + msg + ')');
170
			var deliveryEstimate = parseInt(response['delivery_estimate']);
172
			var deliveryEstimate = parseInt(response['delivery_estimate']);
171
			var isCODAvailableForLocation = (response['is_cod_available_for_location'] === 'true');
173
			var isCODAvailableForLocation = (response['is_cod_available_for_location'] === 'true');
172
			
174
			
173
			if(deliveryEstimate == -1)	{
175
			if(deliveryEstimate == -1)	{
174
				$("#shipping_time").html('This Location is not serviceable');
176
				$("#shipping_time").hide();
-
 
177
				$("#shipping_time_1").show();
175
			} else	{
178
			} else	{
176
				$("#shipping_time").html('Receive in <label class="red">' + deliveryEstimate + ' Business Days</label>');
179
				$("#shipping_time .red").html(deliveryEstimate + ' Business Days');
177
			}
180
			}
178
			
181
			
179
			if (isCODAvailableForLocation)	{
182
			if (isCODAvailableForLocation)	{
180
				$('#cod').show();
183
				$('#cod').show();
181
			} else {
184
			} else {