Shipping - eCart not adding individual items
Hi,
I have the shipping set to one package per product for FedEx in the fedEx Shipping behavior. But the shipping appears to be only reflecting the first product in the cart. So 3 products packaged separately weighing between 10 and 15 pounds each would only cost $6.85.
How can this be resolved?
Below is from my confirm page, but I'm guessing it may be in the cart definition?
<?php
if (!$miCart->IsEmpty()) {
//WA eCart (Copyright 2007, WebAssist)
//WA eCart FedEx Shipping - FedEx
$Shipping_SuccessURL = "";
$Shipping_FailureURL = "shipping_failure.php";
$Shipping_Packaging = 1;
$Shipping_PackageArray = array();
$Shipping_PackageIndex = 0;
$Shipping_Counter = 0;
$Shipping_Parameters = array();
$Shipping_Parameters["FedExKey"] = "xxxxxxxxxxxxxxxxxxx";
$Shipping_Parameters["FedExPassword"] = "xxxxxxxxxxxxxxxxxx";
$Shipping_Parameters["FedExAccount"] = "xxxxxxxxxxxxxxx";
$Shipping_Parameters["FedExMeter"] = "xxxxxxxxxxxxxxxxx";
$Shipping_Parameters["CarrierCode"] = "FDXG";
$Shipping_Parameters["FedExService"] = "FEDEXGROUND";
$Shipping_Parameters["FedExPickUp"] = "REGULARPICKUP";
$Shipping_Parameters["ReturnShipmentIndicator"] = "none";
$Shipping_Parameters["ShipperState"] = "CA";
$Shipping_Parameters["ShipperZip"] = "92806";
$Shipping_Parameters["ShipperCountry"] = "US";
$Shipping_Parameters["ShiptoState"] = "".$_SESSION['eCartCheckoutForm_shipping_state_province'] ."";
$Shipping_Parameters["ShiptoZip"] = "".$_SESSION['eCartCheckoutForm_shipping_postcode'] ."";
$Shipping_Parameters["ShiptoCountry"] = "".$_SESSION['eCartCheckoutForm_shipping_country'] ."";
while (($Shipping_Packaging == 1 && !$miCart->EOF()) || ($Shipping_Packaging == 0 && $Shipping_Counter == 0)) {
if (WA_eCart_FedEx_IsTrueValue("true")) {
$Shipping_PackageArray[] = array();
$Shipping_PackageIndex = sizeof($Shipping_PackageArray)-1;
$Shipping_PackageArray[$Shipping_PackageIndex]["eCart_Quantity"] = (($Shipping_Packaging == 1)?$miCart->DisplayInfo("Quantity"):1);
$Shipping_PackageArray[$Shipping_PackageIndex]["IsPackage"] = "true";
$Shipping_PackageArray[$Shipping_PackageIndex]["Quantity"] = "1";
$Shipping_PackageArray[$Shipping_PackageIndex]["DeclaredValue"] = "".$miCart->GrandTotal() ."";
$Shipping_PackageArray[$Shipping_PackageIndex]["WeightUnits"] = "LBS";
$Shipping_PackageArray[$Shipping_PackageIndex]["PackageWeight"] = "".WA_eCart_FormatNumber($miCart->DisplayInfo('Weight'), true, 1) ."";
$Shipping_PackageArray[$Shipping_PackageIndex]["PackageType"] = "YOURPACKAGING";
$Shipping_PackageArray[$Shipping_PackageIndex]["SizeUnits"] = "IN";
$Shipping_PackageArray[$Shipping_PackageIndex]["PackageLength"] = "".$miCart->DisplayInfo("length") ."";
$Shipping_PackageArray[$Shipping_PackageIndex]["PackageWidth"] = "".$miCart->DisplayInfo("width") ."";
$Shipping_PackageArray[$Shipping_PackageIndex]["PackageHeight"] = "".$miCart->DisplayInfo("height") ."";
//Special Services
$Shipping_PackageArray[$Shipping_PackageIndex]["RESIDENTIALDELIVERY"] = "";
$Shipping_PackageArray[$Shipping_PackageIndex]["RESIDENTIALPICKUP"] = "";
$Shipping_PackageArray[$Shipping_PackageIndex]["INSIDEDELIVERY"] = "";
$Shipping_PackageArray[$Shipping_PackageIndex]["INSIDEPICKUP"] = "";
$Shipping_PackageArray[$Shipping_PackageIndex]["SATURDAYDELIVERY"] = "";
$Shipping_PackageArray[$Shipping_PackageIndex]["SATURDAYPICKUP"] = "";
$Shipping_PackageArray[$Shipping_PackageIndex]["HOLDATLOCATION"] = "";
$Shipping_PackageArray[$Shipping_PackageIndex]["DRYICE"] = "";
$Shipping_PackageArray[$Shipping_PackageIndex]["DANGEROUSGOODS"] = "";
$Shipping_PackageArray[$Shipping_PackageIndex]["HOMEDELIVERYTYPE"] = "";
$Shipping_PackageArray[$Shipping_PackageIndex]["SIGNATUREREQUIRED"] = "";
$Shipping_PackageArray[$Shipping_PackageIndex]["AOD"] = "";
$Shipping_PackageArray[$Shipping_PackageIndex]["AUTOPOD"] = "";
$Shipping_PackageArray[$Shipping_PackageIndex]["NONSTANDARDPACKAGE"] = "";
$Shipping_PackageArray[$Shipping_PackageIndex]["COD"] = "";
$Shipping_PackageArray[$Shipping_PackageIndex]["CODCOLLECTAMOUNT"] = "";
$Shipping_PackageArray[$Shipping_PackageIndex]["CODCOLLECTTYPE"] = "";
}
$Shipping_Counter++;
if ($Shipping_Packaging == 1) $miCart->MoveNext();
}
if ($Shipping_Packaging == 1) $miCart->MoveFirst();
$Shipping_Result = WA_eCart_FedEx_GetRateQuote($miCart, $Shipping_Parameters, $Shipping_PackageArray);
if ($Shipping_Result && $Shipping_SuccessURL != "")
$miCart->redirStr = $Shipping_SuccessURL;
else if (!$Shipping_Result && $Shipping_FailureURL != "") {
Header("Location: " . $Shipping_FailureURL); exit;
}
}
else if (!isset($_SESSION["miCart_FedEx_Success"])) {
WA_eCart_FedEx_SetSessionDefaults($miCart);
}
?>
Thanks for your help,
Jack