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


Estimate Shipping from View Cart Page

Thread began 1/20/2010 3:26 pm by ryanteets270615 | Last modified 1/20/2010 4:45 pm by ryanteets270615 | 1430 views | 2 replies |


Estimate Shipping from View Cart Page

I have a simple form on the View Cart page to get the UPSP shipping estimate. The Form submits to getshipquote.php page that takes the entered zipcode and looks up the cost. The problem is that the quote page does not return back to the $Shipping_SuccessURL once it retrieves the estimate. It does however get the correct estimate and if something other than a zipcode is entered it does redirect to the $Shipping_FailureURL.

Is there something I'm missing here? Thanks!

View_cart.php form:
<form action="getshipquote.php" method="post" name="GetShipping">
<label>Destination Zip code: </label><input name="shipping_postcode" type="text" id="shipping_postcode" size="15" />
<input type="submit" name="button" id="button" value="Apply" /></form>

getshipquote.php code:
//WA eCart Include

//WA eCart UPS Shipping Include
if ("" == "") {
//WA eCart (Copyright 2007, WebAssist)
//WA eCart USPS Shipping - USPS
$Shipping_SuccessURL = "view_cart.php";
$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"] = "United States";
$Shipping_Parameters["UserID"] = "60##########";
$Shipping_Parameters["USPSServer"] = "";
$Shipping_Parameters["CarrierCode"] = "FIRST CLASS";
$Shipping_Parameters["DefaultIntl"] = "none";
$Shipping_Parameters["ShipperZip"] = "90069";
while (($Shipping_Packaging == 1 && !$ecoCart->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)?$ecoCart->DisplayInfo("Quantity"):1);
$Shipping_PackageArray[$Shipping_PackageIndex]["IsPackage"] = "true";
$Shipping_PackageArray[$Shipping_PackageIndex]["Quantity"] = "1";
$Shipping_PackageArray[$Shipping_PackageIndex]["WeightUnits"] = "oz";
/* Replaced these with above entries
$Shipping_PackageArray[$Shipping_PackageIndex]["Quantity"] = "".WA_eCart_FormatNumber($ecoCart->DisplayInfo('Quantity'), true, 1) ."";
$Shipping_PackageArray[$Shipping_PackageIndex]["WeightUnits"] = "".strtolower($ecoCart->WeightUnits) ."";
$Shipping_PackageArray[$Shipping_PackageIndex]["PackageWeight"] = "".WA_eCart_FormatNumber($ecoCart->TotalColumn('TotalWeight'), true, 1) ."";
$Shipping_PackageArray[$Shipping_PackageIndex]["PackageType"] = "YOURPACKAGING";
$Shipping_PackageArray[$Shipping_PackageIndex]["PackageSize"] = "REGULAR";
$Shipping_PackageArray[$Shipping_PackageIndex]["PackageMachinable"] = "false";
$Shipping_PackageArray[$Shipping_PackageIndex]["IPackageType"] = "none";
//Special Services
if ($Shipping_Packaging == 1) $ecoCart->MoveNext();
if ($Shipping_Packaging == 1) $ecoCart->MoveFirst();
$Shipping_Result = WA_eCart_USPS_GetRateQuote($ecoCart, $Shipping_Parameters, $Shipping_PackageArray);
if ($Shipping_Result && $Shipping_SuccessURL != "")
$ecoCart->redirStr = $Shipping_SuccessURL;
else if (!$Shipping_Result && $Shipping_FailureURL != "") {
Header("Location: " . $Shipping_FailureURL); exit;
else if (!isset($_SESSION["ecoCart_USPS_Success"])) {

Sign in to reply to this post

Jason ByrnesWebAssist

make sure you have the following code just before the doctype tag.


// WA eCart Redirect
if ($ecoCart_PHP->redirStr != "")     {
header("Location: ".$ecoCart_PHP->redirStr);

if it still doesn't work, there may be a php error occuring, add the following at line 1 to turn error reporting on:


Sign in to reply to this post


this worked

not sure why, but your suggestion did not work either. But I was able to figure this out:

// WA eCart Redirect
if ($_SESSION["ecoCart_USPS_Success"] != "") {
header("Location: ".$Shipping_SuccessURL);

Thank you!!

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