DevBuilder Dev Articles News Articles DevBuilder Forum Code Login Sign Up
Username:  Password:    
 

Add Your ResourcesAdd Your Resource   Write the reviewsPost Review   Read the reviewsRead Reviews   Printer friendly versionPrint  

Rate This Article

Using Ranges to figure shipping Article Rating:

Active Server Pages 3.0: Using ranges to figure out shipping costs

This sample demonstrates how to use simple ranges to calculate shipping costs.


ASP Code:

<%
If Shipping = "" Then

   If Subtotal <= 10 Then
   Shipping = "Shipping Number 1"
   End If

   If Shipping = "" Then
      If Subtotal <= 24 Then
      Shipping = "Shipping Number 2"
      End If
   End If

   If Shipping = "" Then
      If Subtotal <= 48 Then
      Shipping = "Shipping Number 3"
      End If
   End If

   If Shipping = "" Then
      If Subtotal <= 100 Then
      Shipping = "Shipping Number 4"
      End If
   End If

End If

If Shipping = "" Then
Amount = 100
ShippingCost = 20
Do While Shipping = ""
   If Subtotal <= Amount Then
   Shipping = ShippingCost
   Else
   Amount = Amount + 100
   ShippingCost = ShippingCost + 20
   End If
Loop
End If
%>

Requirements:
Internet Information Server 4 or 5, Unix Chili!ASP
Running the Sample:
Upload code to hosting server and run via url bar



Add Your ResourcesAdd Your Resource   Write the reviewsPost Review   Read the reviewsRead Reviews   Printer friendly versionPrint  

Rate This Article