The shipping code generated for me when usig the checkout wizard looks like:
<?php
//WA eCart UPS Shipping Include
require_once("WA_eCart/WA_eCart_USPS_PHP.php");
?>
<?php
if ($_SERVER["REQUEST_METHOD"] == "POST") {
//WA eCart (Copyright 2007, WebAssist)
//WA eCart USPS Shipping - USPS
$Shipping_SuccessURL = "";
$Shipping_FailureURL = "shipping_failure.php";
$Shipping_Packaging = 0;
$Shipping_PackageArray = array();
$Shipping_PackageIndex = 0;
$Shipping_Counter = 0;
$Shipping_Parameters = array();
$Shipping_Parameters["ShiptoZip"] = "".((isset($_POST["shipping_postcode"]))?$_POST["shipping_postcode"]:"") ."";
$Shipping_Parameters["ShiptoCountry"] = "".((isset($_POST["shipping_country"]))?$_POST["shipping_country"]:"") ."";
$Shipping_Parameters["UserID"] = "########";
$Shipping_Parameters["USPSServer"] = "http://production.shippingapis.com/shippingapi.dll";
$Shipping_Parameters["CarrierCode"] = "FIRST CLASS";
$Shipping_Parameters["DefaultIntl"] = "none";
$Shipping_Parameters["ShipperZip"] = "92102";
while (($Shipping_Packaging == 1 && !$eCart1->EOF()) || ($Shipping_Packaging == 0 && $Shipping_Counter == 0)) {
if (WA_eCart_USPS_IsTrueValue("true")) {
$Shipping_PackageArray[] = array();
$Shipping_PackageIndex = sizeof($Shipping_PackageArray)-1;
$Shipping_PackageArray[$Shipping_PackageIndex]["eCart_Quantity"] = (($Shipping_Packaging == 1)?$eCart1->DisplayInfo("Quantity"):1);
$Shipping_PackageArray[$Shipping_PackageIndex]["IsPackage"] = "true";
$Shipping_PackageArray[$Shipping_PackageIndex]["Quantity"] = "".WA_eCart_FormatNumber($eCart1->DisplayInfo('Quantity'), true, 1) ."";
$Shipping_PackageArray[$Shipping_PackageIndex]["WeightUnits"] = "OZ";
$Shipping_PackageArray[$Shipping_PackageIndex]["PackageWeight"] = "".WA_eCart_FormatNumber($eCart1->TotalColumn('TotalWeight'), true, 1) ."";
$Shipping_PackageArray[$Shipping_PackageIndex]["PackageType"] = "YOURPACKAGING";
$Shipping_PackageArray[$Shipping_PackageIndex]["PackageSize"] = "REGULAR";
$Shipping_PackageArray[$Shipping_PackageIndex]["PackageMachinable"] = "true";
$Shipping_PackageArray[$Shipping_PackageIndex]["IPackageType"] = "Package";
//Special Services
}
$Shipping_Counter++;
if ($Shipping_Packaging == 1) $eCart1->MoveNext();
}
if ($Shipping_Packaging == 1) $eCart1->MoveFirst();
$Shipping_Result = WA_eCart_USPS_GetRateQuote($eCart1, $Shipping_Parameters, $Shipping_PackageArray);
if ($Shipping_Result && $Shipping_SuccessURL != "")
$eCart1->redirStr = $Shipping_SuccessURL;
else if (!$Shipping_Result && $Shipping_FailureURL != "") {
Header("Location: " . $Shipping_FailureURL); exit;
}
}
else if (!isset($_SESSION["eCart1_USPS_Success"])) {
WA_eCart_USPS_SetSessionDefaults($eCart1);
}
?>
this is using a cart name eCart1. The shipping rate is determined by starting and ending zip code as well as weight.
to get some information on why you are getting the shipping rate, try adding the following ode on the confirm page in the bady:
<?php
if(!session_id()) session_start();
echo("<br />Full Request: ".htmlentities($_SESSION["<your cart name>_USPS_FullRequest"]));
echo("<br />Full Response: ". htmlentities($_SESSION["<your cart name>_USPS_FullResponse"]));
?>
substitute:
<your cart name>
for the name of your cart object. This will tell us what is being sent to USPS and what us being sent back.