multiple shipping choice
Hi Jason ... some time it does match but it varies if I go back to modify my choice of shipper type ... my client just gave me a sample address and product to use to compare with his online calculations when runinng it thru UPS.com or USPS.com
i pre-populated the checkout page with the info .. the address state is INDIANA the product is Structo Wrecker Auto Truck
here's a bit explanation of how i did the shipping choices which maybe the issue?:
on the checkout i have a dropdown with the choices then that is set on the confirm as a session var eCartCheckoutForm_Ship_Type ... then i use that for WAGLOBAL_Shipping which i use to select the WA shipping include and code with the settings of Priority, express etc ...
<?php
if($_SESSION['eCartCheckoutForm_Ship_Type'] == "01")
{
$WAGLOBAL_Shipping = 1;
}
else if($_SESSION['eCartCheckoutForm_Ship_Type'] == "02")
{
$WAGLOBAL_Shipping = 2;
}
else if($_SESSION['eCartCheckoutForm_Ship_Type'] == "03")
{
$WAGLOBAL_Shipping = 3;
}
else if($_SESSION['eCartCheckoutForm_Ship_Type'] == "04")
{
$WAGLOBAL_Shipping = 4;
}
else if($_SESSION['eCartCheckoutForm_Country'] != "US")
{
$WAGLOBAL_Shipping = 5;
}
// if Using UPS
?>
<?php
// calculate shipping costs using UPS
?>
<?php
if($WAGLOBAL_Shipping == 1) {
?>
<?php
//WA eCart UPS Shipping Include
require_once("WA_eCart/WA_eCart_UPS_PHP.php");
?>
<?php
if ($_SERVER["REQUEST_METHOD"] == "POST") {
//WA eCart (Copyright 2007, WebAssist)
//WA eCart UPS Shipping - UPS
$Shipping_SuccessURL = "";
$Shipping_FailureURL = "shipping_failure.php";
$Shipping_Packaging = 1;
$Shipping_PackageArray = array();
$Shipping_PackageIndex = 0;
$Shipping_Counter = 0;
$Shipping_Parameters = array();
$Shipping_Parameters["UserID"] = "americantoys";
$Shipping_Parameters["Password"] = "Toys4u2012";
$Shipping_Parameters["AccessKey"] = "FC98C4007ED02F08";
$Shipping_Parameters["CarrierCode"] = "03";
$Shipping_Parameters["PickupType"] = "06";
$Shipping_Parameters["CustomerClass"] = "03";
$Shipping_Parameters["ShipperNumber"] = "471V5W";
$Shipping_Parameters["ShipperCity"] = "Chester";
$Shipping_Parameters["ShipperState"] = "NJ";
$Shipping_Parameters["ShipperZip"] = "07930";
$Shipping_Parameters["ShipperCountry"] = "US";
$Shipping_Parameters["ShiptoCity"] = "".((isset($_POST["shipping_city"]))?$_POST["shipping_city"]:"") ."";
$Shipping_Parameters["ShiptoState"] = "".((isset($_POST["shipping_state_province"]))?$_POST["shipping_state_province"]:"") ."";
$Shipping_Parameters["ShiptoZip"] = "".((isset($_POST["shipping_postcode"]))?$_POST["shipping_postcode"]:"") ."";
$Shipping_Parameters["ShiptoCountry"] = "".((isset($_POST["shipping_country"]))?$_POST["shipping_country"]:"") ."";
while (($Shipping_Packaging == 1 && !$eCart3->EOF()) || ($Shipping_Packaging == 0 && $Shipping_Counter == 0)) {
if (WA_eCart_UPS_IsTrueValue("true")) {
$Shipping_PackageArray[] = array();
$Shipping_PackageIndex = sizeof($Shipping_PackageArray)-1;
$Shipping_PackageArray[$Shipping_PackageIndex]["eCart_Quantity"] = (($Shipping_Packaging == 1)?$eCart3->DisplayInfo("Quantity"):1);
$Shipping_PackageArray[$Shipping_PackageIndex]["IsPackage"] = "true";
$Shipping_PackageArray[$Shipping_PackageIndex]["Quantity"] = "1";
$Shipping_PackageArray[$Shipping_PackageIndex]["WeightUnits"] = "LBS";
$Shipping_PackageArray[$Shipping_PackageIndex]["PackageWeight"] = "".WA_eCart_FormatNumber($eCart3->DisplayInfo('Weight'), true, 1) ."";
$Shipping_PackageArray[$Shipping_PackageIndex]["PackageType"] = "02";
$Shipping_PackageArray[$Shipping_PackageIndex]["SizeUnits"] = "IN";
$Shipping_PackageArray[$Shipping_PackageIndex]["PackageLength"] = "".$eCart3->DisplayInfo("Length") ."";
$Shipping_PackageArray[$Shipping_PackageIndex]["PackageWidth"] = "".$eCart3->DisplayInfo("Width") ."";
$Shipping_PackageArray[$Shipping_PackageIndex]["PackageHeight"] = "".$eCart3->DisplayInfo("Height") ."";
//Special Services
}
$Shipping_Counter++;
if ($Shipping_Packaging == 1) $eCart3->MoveNext();
}
if ($Shipping_Packaging == 1) $eCart3->MoveFirst();
$Shipping_Result = WA_eCart_UPS_GetRateQuote($eCart3, $Shipping_Parameters, $Shipping_PackageArray);
if ($Shipping_Result && $Shipping_SuccessURL != "")
$eCart3->redirStr = $Shipping_SuccessURL;
else if (!$Shipping_Result && $Shipping_FailureURL != "") {
Header("Location: " . $Shipping_FailureURL); exit;
}
}
else if (!isset($_SESSION["eCart3_UPS_Success"])) {
WA_eCart_UPS_SetSessionDefaults($eCart3);
}
?>