ASP ShipCalc™ Documentation

 

Sample Usage

Sample Script Descriptions:
  • hardcoded.asp - a complete sample which calculates rates from hardcoded data passed to this shipcalc function.  The return is displayed with the displayrates function and cleanuprates is also called.
     
  • hardcodedcustom.asp - the same as hardcoded except that it uses the rates collection to display the information rather than the displayrates function
     
  • Multi-File Sample: The following files are part of a sample which demonstrates the full dataflow from dynamically setting the destination address to displaying the available rates to selecting a rate and finally to parsing the price and other information from the selected rate and displaying this information.  The first file is shipform.asp which uses the countrylist function and includes a HTML form which collects other shipping details.  This posts to shipcalc.asp which uses the shipcalc method with dynamic inputs from the shipform.asp post.  Rates are displayed with displayrates and cleanup is done with cleanuprates.  Selecting a specific rate from the list now posts to process.asp.  Process.asp parses the single shipping element and formats the output.
 
Include Requirements:
In order to have access to the various functions and variables in ASP ShipCalc you must include the main ship calctools with the following line at the top of your page (and outside of the <% %> asp script tags:
 
<!--#include file="shipcalctools.asp"-->

This file also requires that countrymap.asp be in the same directory with shipcalctools.asp.  This file maps standard country codes which ASP ShipCalc accepts to the specific country names / codes which the individual shipping companies require.

To access the countrylist function you must include:


<!--#include file="countrycombo.asp"-->

Since this function is typically used on its own in an input form it is in a separate file.
 
 
Returning results in a combobox (after a shipcalc):
displayrates "combo","Shipping" 
 
Returning results in list (after a shipcalc):
for ship = 1 to ratecount
  Response.write(rates(ship).Item("Shipper"))&"<BR>"
  Response.write(rates(ship).Item("Service"))&"<BR>"
  Response.write(rates(ship).Item("Postage"))&"<BR>"
  Response.write(rates(ship).Item("Time"))&"<BR><BR>"
next
 
Returning results with radio buttons (after a shipcalc):
displayrates "radio","Shipping" 
 
Component Generated Country list with value set to valid country code:
countrylist "destcountry","US"

 

Corporate Web Solutions 2000,2001.