close ad
WARNING: Do Not Install the DREAMWEAVER CC 2017 Update »
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

USPS Shipping to canada not calculating

Thread began 8/03/2015 8:17 pm by ccdantas101117 | Last modified 8/04/2015 3:05 pm by Ray Borduin | 216 views | 2 replies |

ccdantas101117

USPS Shipping to canada not calculating

I have the shipping calculation integrated using the USPS V4 national - working great and the V2 for international. I do have the new USPS file uploaded and the USPS user ID is activated on the USPS Production server. I don't know why when I enter Canada and the Zip it goes straight to the shipping failure page but no error code is presented. Below is the page code. I deleted the user id for security reasons. Any help will be appreciated.

//-------------- // ---------------------//
<?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"] = "xxxxxxxxxxxxx";
$Shipping_Parameters["USPSServer"] = "http://production.shippingapis.com/ShippingAPI.dll";
$Shipping_Parameters["CarrierCode"] = "PRIORITY";
$Shipping_Parameters["DefaultIntl"] = "Priority Mail International";
$Shipping_Parameters["ShipperZip"] = "33026";
while (($Shipping_Packaging == 1 && !$sbrimcart->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)?$sbrimcart->DisplayInfo("Quantity"):1);
$Shipping_PackageArray[$Shipping_PackageIndex]["IsPackage"] = "true";
$Shipping_PackageArray[$Shipping_PackageIndex]["Quantity"] = "1";
$Shipping_PackageArray[$Shipping_PackageIndex]["WeightUnits"] = "lb";
$Shipping_PackageArray[$Shipping_PackageIndex]["PackageWeight"] = "".$sbrimcart->TotalColumn("TotalWeight") ."";
$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) $sbrimcart->MoveNext();
}
if ($Shipping_Packaging == 1) $sbrimcart->MoveFirst();
$Shipping_Result = WA_eCart_USPS_GetRateQuote($sbrimcart, $Shipping_Parameters, $Shipping_PackageArray);
if ($Shipping_Result && $Shipping_SuccessURL != "")
$sbrimcart->redirStr = $Shipping_SuccessURL;
else if (!$Shipping_Result && $Shipping_FailureURL != "") {
Header("Location: " . $Shipping_FailureURL); exit;
}
}
else if (!isset($_SESSION["sbrimcart_USPS_Success"])) {
WA_eCart_USPS_SetSessionDefaults($sbrimcart);
}
?>

Sign in to reply to this post

Ray BorduinWebAssist

It looks like USPS made some changes that require a few extra xml values for canada. I've attached a new include file that should address this problem. We will update it in the next eCart release.

Attached Files
WA_eCart_USPS_PHP.php
Sign in to reply to this post

ccdantas101117

Thank You

Thank you Ray.

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

Content

rating

Layout

rating

Ease of use

rating

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...