close ad
Databridge V2 with MySQLi support IS Now Available!
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues


eCart / UPS Shipping

Thread began 6/22/2010 5:44 pm by suzette309299 | Last modified 6/22/2010 9:58 pm by Eric Mittman | 626 views | 1 replies |


eCart / UPS Shipping

An eCart that was built with an older version of the software is not responding to shipping changes. Everything seems to be working properly except that the only thing the cart will do is add a flat shipping charge to each item-so if a person orders 13 of an item the shipping charge becomes 13 X $13. We have all the information to access the UPS API on confirm.php. The goal is to have the cart add a shipping charge based on weight of the total order rather than a flat charge per item. It does not appear to be registering changes made to shipping.

Code from confirm.php is below:

//WA eCart Include
//**** CODE

if (!session_id()) session_start();
$_SESSION["eCartCheckoutForm_state_province"] = "".((isset($_POST["state_province"]))?$_POST["state_province"]:"") ."";
if (!session_id()) session_start();
$_SESSION["eCartCheckoutForm_country"] = "".((isset($_POST["country"]))?$_POST["country"]:"") ."";
//WA eCart UPS Shipping Include
//WA eCart (Copyright 2007, WebAssist)
//WA eCart UPS Shipping - UPS
$Shipping_SuccessURL = "";
$Shipping_FailureURL = "shipping_failure.php";
$Shipping_Packaging = 0;
$Shipping_PackageArray = array();
$Shipping_PackageIndex = 0;
$Shipping_Counter = 0;
$Shipping_Parameters = array();
$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"]:"") ."";
$Shipping_Parameters["UserID"] = "xxxxxxxxx";
$Shipping_Parameters["Password"] = "xxxxxxxx";
$Shipping_Parameters["AccessKey"] = "xxxxxxxxxxxxxxxx";
$Shipping_Parameters["CarrierCode"] = "03";
$Shipping_Parameters["PickupType"] = "01";
$Shipping_Parameters["CustomerClass"] = "none";
$Shipping_Parameters["ShipperNumber"] = "";
$Shipping_Parameters["ShipperCity"] = "xxxxxx";
$Shipping_Parameters["ShipperState"] = "WA";
$Shipping_Parameters["ShipperZip"] = "xxxxxx";
$Shipping_Parameters["ShipperCountry"] = "US";
while (($Shipping_Packaging == 1 && !$eCart1->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)?$eCart1->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"] = "1";
$Shipping_PackageArray[$Shipping_PackageIndex]["PackageType"] = "03";
$Shipping_PackageArray[$Shipping_PackageIndex]["SizeUnits"] = "IN";
$Shipping_PackageArray[$Shipping_PackageIndex]["PackageLength"] = "6";
$Shipping_PackageArray[$Shipping_PackageIndex]["PackageWidth"] = "6";
$Shipping_PackageArray[$Shipping_PackageIndex]["PackageHeight"] = "14";
//Special Services
if ($Shipping_Packaging == 1) $eCart1->MoveNext();
if ($Shipping_Packaging == 1) $eCart1->MoveFirst();
$Shipping_Result = WA_eCart_UPS_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);
else if (!isset($_SESSION["eCart1_UPS_Success"])) {
if ($eCart1->IsEmpty()) {
$eCart1->redirStr = "cart.php";
$eCart1->cartAction = "RedirectIfEmpty";
// WA eCart Redirect
if ($eCart1->redirStr != "") {
header("Location: ".$eCart1->redirStr);

Sign in to reply to this post

Eric Mittman

What is the specific version of eCart that you are working with and what changes have you tried to make in the server behavior? You should have an option for a single package for the entire order, I think this is the option that would make it work the way you would like it.

Please post back with these details and also a copy of your WA_ecart folder and this page in question in a zip archive so that we can take a look at them.

Sign in to reply to this post

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question





Ease of use


security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...