<%@ Language=VBScript %> <% '************************************************************************* ' DO NOT MODIFY THIS SCRIPT IF YOU WANT UPDATES TO WORK! ' Function : UPS Online Shipping Rates ' Product : CandyPress Store Administration ' Version : 2.5 ' Modified : February 2004 ' Copyright: Copyright (C) 2004 CandyPress.Com ' See "license.txt" for this product for details regarding ' licensing, usage, disclaimers, distribution and general ' copyright requirements. If you don't have a copy of this ' file, you may request one at webmaster@candypress.com '************************************************************************* Option explicit Response.Buffer = true const adminLevel = 0 %> <% 'Form variables dim UPSactive dim UPSfromZip dim UPSfromCntry dim UPSpickupType dim UPSpackType dim UPSshipCode dim UPSweightUnit dim UPSaddrType 'Database variables dim mySQL, cn, rs 'Work Fields dim xmlTest '************************************************************************* 'Open Database call openDb() 'Store Configuration if loadConfig() = false then response.redirect "sysMsg.asp?errMsg=" & server.URLEncode("Could not load Store Configuration settings.") end if 'Get current configuration settings from database mySQL = "SELECT configVar, configVal " _ & "FROM storeAdmin " _ & "WHERE adminType = 'S'" set rs = openRSexecute(mySQL) do while not rs.EOF select case trim(lCase(rs("configVar"))) case lCase("UPSactive") UPSactive = rs("configVal") case lCase("UPSfromZip") UPSfromZip = rs("configVal") case lCase("UPSfromCntry") UPSfromCntry = rs("configVal") case lCase("UPSpickupType") UPSpickupType = rs("configVal") case lCase("UPSpackType") UPSpackType = rs("configVal") case lCase("UPSshipCode") UPSshipCode = rs("configVal") case lCase("UPSweightUnit") UPSweightUnit = rs("configVal") case lCase("UPSaddrType") UPSaddrType = rs("configVal") end select rs.MoveNext loop call closeRS(rs) 'Close Database call closedb() %>

Shipping - UPS Online Shipping Rates

<% 'Page Tabs call shipTabs("UP") if len(trim(Request.QueryString("msg"))) > 0 then %> <%=Request.QueryString("msg")%>

<% end if %> Notes :
Note 1. The online rate calulation routine is restricted to packages weighing 150 pounds or less. In addition, maximum package size is 165 inches. Stores that sell irregularly shaped or oversized items requiring additional shipping charges, may find that the shipping rates are not adjusted for these items, or that the software will not be able to calculate rates for those items. As a precaution, always enter a few typical test orders to verify that you are getting the shipping rate results you expect.
Note 2. The rates returned by this routine will always be in the currency of the shipment's originating country. In other words, if you are shipping from Canada to the US, the rates returned will be in Canadian dollars. Similarly, if you are shipping from the US to Canada, the rates returned will be in US dollars.

Step-By-Step :
Step 1. XML - Your web server must be able to communicate with the UPS servers via Microsoft's XML components. Checking for XML components --> <% on error resume next set xmlTest = Server.CreateObject("Microsoft.XMLDOM") if err.number = 0 then set xmlTest = server.Createobject(MSXMLprogID) if err.number = 0 then Response.Write "COMPONENTS INSTALLED" else Response.Write "MSXML NOT FOUND" end if else Response.Write "XMLDOM NOT FOUND" end if set xmlTest = nothing on error goto 0 %>
Step 2. IIS 5.0 - You will need to have IIS 5.0 (or later) to use the shipping routine. You currently have <%=Request.ServerVariables("SERVER_SOFTWARE")%> installed.
Step 3. COUNTRY CODES - You will need to ensure that the country codes assigned to each country in your store are valid ISO country codes (by default they are). UPS only accepts the ISO format.
Step 4. SHIPMENT WEIGHT - The weight of your products must be entered into your database as Pounds or Kilograms (non-US only). You can have fractions (eg. 0.5 Pounds, 1.89 Pounds).
Step 5. UPS ACCOUNT - Before proceeding to the next step, you must CLICK HERE to Register with UPS. When you're done, close the registration wizard and complete the form below.
Step 6. CONFIGURE - Complete the form below to configure your store for UPS Online Rates.

Active? > (Check box to activate Online UPS rates)
Country Code (Origination ISO Country Code)
Zip/Post Code (Origination Zip/Post Code)
Select UPS Service
Pickup Type
Package Type
Weight Type (US customers can only specify Pounds)
Address Type (Residential or Business address rates)