FedEx Shipping "Per Item" Charge
I'm trying to have FedEx shipping quotes based on a "One package per item purchased".
It's selected in FedEx eCart server behavior screen.
It still calculates as one package for the entire order. This is important because I have products that will exceed the 150lbs limit unless shipped as separate packages.
Here's my FedEx code:
<%
if (Request.ServerVariables("Request_Method") = "POST") then
'WA eCart (Copyright 2007, WebAssist)
'WA eCart FedEx Shipping - FedEx
Dim Shipping_SuccessURL, Shipping_FailureURL, Shipping_Packaging, Shipping_PackageIndex, Shipping_Counter, Shipping_Parameters, Shipping_SubPackage, Shipping_PackageArray
set Shipping_Parameters = new WA_eCart_FedEx_Parameters
set Shipping_SubPackage = new WA_eCart_FedEx_Package
Shipping_SuccessURL = ""
Shipping_FailureURL = "shipping_failure.asp"
Shipping_Packaging = 1
Shipping_PackageArray = Array()
Shipping_PackageIndex = 0
Shipping_Counter = 0
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.FedExAccount = "xxxxxxxx"
Shipping_Parameters.FedExMeter = "xxxxxx"
Shipping_Parameters.FedExServer = "https://gateway.fedex.com:443/GatewayDC"
If cStr(Request.Form("FedEx_Service")) = "FEDEXGROUND" Then
Shipping_Parameters.CarrierCode = "FDXG"
else
Shipping_Parameters.CarrierCode = "FDXE"
end if
Shipping_Parameters.FedExService = "" & cStr(Request.Form("FedEx_Service") ) & ""
Shipping_Parameters.FedExPickUp = "REGULARPICKUP"
Shipping_Parameters.ReturnShipmentIndicator = "none"
Shipping_Parameters.ShipperState = "CA"
Shipping_Parameters.ShipperZip = "92649"
Shipping_Parameters.ShipperCountry = "US"
while ((Shipping_Packaging = 1 AND not WA_eCart_EOF(madrid)) OR (Shipping_Packaging = 0 AND Shipping_Counter = 0))
if (WA_eCart_FedEx_IsTrueValue("true")) then
ReDim Preserve Shipping_PackageArray(Shipping_PackageIndex+1)
set Shipping_SubPackage = new WA_eCart_FedEx_Package
if (Shipping_Packaging = 1) then
Shipping_SubPackage.eCart_Quantity = WA_eCart_DisplayInfo(madrid, "Quantity")
else
Shipping_SubPackage.eCart_Quantity = 1
end if
Shipping_SubPackage.IsPackage = "true"
Shipping_SubPackage.Quantity = "" & cStr(WA_eCart_DisplayInfo(madrid, "Quantity")) & ""
Shipping_SubPackage.DeclaredValue = "0"
Shipping_SubPackage.WeightUnits = "LBS"
Shipping_SubPackage.PackageWeight = "" & cStr(WA_eCart_FormatNumber(WA_eCart_DisplayInfo(madrid, "Weight"), true, 1)) & ""
Shipping_SubPackage.PackageType = "YOURPACKAGING"
Shipping_SubPackage.SizeUnits = "IN"
Shipping_SubPackage.PackageLength = "2"
Shipping_SubPackage.PackageWidth = "2"
Shipping_SubPackage.PackageHeight = "2"
'Special Services
Shipping_SubPackage.RESIDENTIALDELIVERY = ""
Shipping_SubPackage.RESIDENTIALPICKUP = ""
Shipping_SubPackage.INSIDEDELIVERY = ""
Shipping_SubPackage.INSIDEPICKUP = ""
Shipping_SubPackage.SATURDAYDELIVERY = ""
Shipping_SubPackage.SATURDAYPICKUP = ""
Shipping_SubPackage.HOLDATLOCATION = ""
Shipping_SubPackage.DRYICE = ""
Shipping_SubPackage.DANGEROUSGOODS = ""
Shipping_SubPackage.HOMEDELIVERYTYPE = ""
Shipping_SubPackage.SIGNATUREREQUIRED = ""
Shipping_SubPackage.AOD = ""
Shipping_SubPackage.AUTOPOD = ""
Shipping_SubPackage.NONSTANDARDPACKAGE = ""
Shipping_SubPackage.COD = ""
Shipping_SubPackage.CODCOLLECTAMOUNT = ""
Shipping_SubPackage.CODCOLLECTTYPE = ""
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 madrid = WA_eCart_MoveNext(madrid)
end if
wend
if (Shipping_Packaging = 1) then
set madrid = WA_eCart_MoveFirst(madrid)
end if
Shipping_Result = WA_eCart_FedEx_GetRateQuote(madrid, Shipping_Parameters, Shipping_PackageArray)
if (Shipping_Result) then
if (Shipping_SuccessURL <> "") then
madrid_redirStr = Shipping_SuccessURL
end if
elseif (Shipping_FailureURL <> "") then
Response.Redirect(Shipping_FailureURL)
end if
elseif (cStr(Session("madrid_FedEx_Success")) = "") then
WA_eCart_FedEx_SetSessionDefaults(madrid)
end if
%>
Thanks