<%@ Language=VBScript %> <% '************************************************************************* ' DO NOT MODIFY THIS SCRIPT IF YOU WANT UPDATES TO WORK! ' Function : Canada Post 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 CPactive dim CPmerchantID dim CPfromZip dim CPsizeL dim CPsizeW dim CPsizeH '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("CPactive") CPactive = rs("configVal") case lCase("CPmerchantID") CPmerchantID = rs("configVal") case lCase("CPfromZip") CPfromZip = rs("configVal") case lCase("CPsizeL") CPsizeL = rs("configVal") case lCase("CPsizeW") CPsizeW = rs("configVal") case lCase("CPsizeH") CPsizeH = rs("configVal") end select rs.MoveNext loop call closeRS(rs) 'Close Database call closedb() %>

Shipping - Canada Post Online Shipping Rates

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

<% end if %> Notes :
Note 1. Stores that sell irregularly shaped or oversized items requiring additional shipping charges may find that the shipping rates returned by Canada Post are not adjusted for these items. Always enter a few typical test orders to verify that you are getting the shipping rate results you want.
Note 2. The rates returned by this routine will always be in Canadian dollars.
Note 3. Canada Post currently only provide shipping for packages that originate from within Canada.

Step-By-Step :
Step 1. XML - Your web server must be able to communicate with the Canada Post 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). Also, shipping to the US requires that US state codes are the standard 2 letter abbreviation (by default they are).
Step 4. SHIPMENT WEIGHT - The weight of your products must be entered into your database as Kilograms. You can have fractions (eg. 1.89 Kilograms).
Step 5. CANADA POST PROFILE - Before proceeding to the next step, you must request a Shipping Profile. Send the request to sellonline@canadapost.ca. You will initially receive a test account, but you can request to move the account to production immediately because the module is already tested.
Step 6. CONFIGURE - Complete the form below to configure your store for Canada Post Online Rates.

Active? > (Check box to activate Canada Post rates)
User ID (Value is case sensitive)
Post Code (Origination Post Code)
Avg. Parcel Size
(Centimeters)
Length Width Height