<%
if (Request.ServerVariables("Request_Method") = "POST") then
'WA eCart (Copyright 2007, WebAssist)
'WA eCart UPS Shipping - UPS
Dim Shipping_SuccessURL, Shipping_FailureURL, Shipping_Packaging, Shipping_PackageIndex, Shipping_Counter, Shipping_Parameters, Shipping_SubPackage, Shipping_PackageArray
set Shipping_Parameters = new WA_eCart_UPS_Parameters
set Shipping_SubPackage = new WA_eCart_UPS_Package
Shipping_SuccessURL = ""
Shipping_FailureURL = "shipping_failure.asp"
Shipping_Packaging = 0
Shipping_PackageArray = Array()
Shipping_PackageIndex = 0
Shipping_Counter = 0
Shipping_Parameters.ShiptoCity = "" & cStr(Request.Form("shipping_city")) & ""
Shipping_Parameters.ShiptoState = "" & cStr(Request.Form("shipping_state_province")) & ""
Shipping_Parameters.ShiptoZip = "" & cStr(Request.Form("shipping_postcode")) & ""
Shipping_Parameters.ShiptoCountry = "" & cStr(Request.Form("shipping_country")) & ""
Shipping_Parameters.UserID = ""
Shipping_Parameters.Password = ""
Shipping_Parameters.AccessKey = ""
Shipping_Parameters.CarrierCode = ""
Shipping_Parameters.PickupType = ""
Shipping_Parameters.CustomerClass = ""
Shipping_Parameters.ShipperNumber = ""
Shipping_Parameters.ShipperCity = ""
Shipping_Parameters.ShipperState = ""
Shipping_Parameters.ShipperZip = ""
Shipping_Parameters.ShipperCountry = "US"
while ((Shipping_Packaging = 1 AND not WA_eCart_EOF(neoCart)) OR (Shipping_Packaging = 0 AND Shipping_Counter = 0))
if (WA_eCart_UPS_IsTrueValue("true")) then
ReDim Preserve Shipping_PackageArray(Shipping_PackageIndex+1)
set Shipping_SubPackage = new WA_eCart_UPS_Package
if (Shipping_Packaging = 1) then
Shipping_SubPackage.eCart_Quantity = WA_eCart_DisplayInfo(neoCart, "Quantity")
else
Shipping_SubPackage.eCart_Quantity = 1
end if
Shipping_SubPackage.IsPackage = "true"
Shipping_SubPackage.Quantity = "1"
Shipping_SubPackage.WeightUnits = "LBS"
Shipping_SubPackage.PackageWeight = "" & cStr(WA_eCart_DisplayInfo(neoCart, "TotalWeight")) & ""
Shipping_SubPackage.PackageType = "02"
Shipping_SubPackage.SizeUnits = "IN"
Shipping_SubPackage.PackageLength = "12"
Shipping_SubPackage.PackageWidth = "12"
Shipping_SubPackage.PackageHeight = "8"
'Special Services
set Shipping_PackageArray(Shipping_PackageIndex) = Shipping_SubPackage
Shipping_PackageIndex = Shipping_PackageIndex+1
end if
Shipping_Counter = Shipping_Counter + 1
if (Shipping_Packaging = 1) then
set neoCart = WA_eCart_MoveNext(neoCart)
end if
wend
if (Shipping_Packaging = 1) then
set neoCart = WA_eCart_MoveFirst(neoCart)
end if
Shipping_Result = WA_eCart_UPS_GetRateQuote(neoCart, Shipping_Parameters, Shipping_PackageArray)
if (Shipping_Result) then
if (Shipping_SuccessURL <> "") then
neoCart_redirStr = Shipping_SuccessURL
end if
elseif (Shipping_FailureURL <> "") then
Response.Redirect(Shipping_FailureURL)
end if
elseif (cStr(Session("neoCart_UPS_Success")) = "") then
WA_eCart_UPS_SetSessionDefaults(neoCart)
end if
%>
<%
if (Request.ServerVariables("Request_Method") = "POST") then
Session("eCartCheckoutForm_shipping_country") = "" & cStr(Request.Form("shipping_country")) & ""
end if
%>
<%
if (Request.ServerVariables("Request_Method") = "POST") then
Session("eCartCheckoutForm_shipping_postcode") = "" & cStr(Request.Form("shipping_postcode")) & ""
end if
%>
<%
if (Request.ServerVariables("Request_Method") = "POST") then
Session("eCartCheckoutForm_shipping_state_province") = "" & cStr(Request.Form("shipping_state_province")) & ""
end if
%>