close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

eCart / UPS Shipping

Thread began 6/22/2010 2:44 pm by suzette309299 | Last modified 6/22/2010 6:58 pm by suzette309299 | 734 views | 1 replies

suzette309299

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:

<?php
//WA eCart Include
require_once("WA_eCart/eCart1_PHP.php");
?><?php
$eCart1->GetContent();
//**** CODE
$tax=$_SESSION['tax'];
$charges=$_SESSION['charges'];
$discounts=$_SESSION['discounts'];
$totalPrice=$_SESSION['totalPrice'];
$totalShipping=$_SESSION['totalShipping'];


?>
<?php
if (!session_id()) session_start();
if($_SERVER["REQUEST_METHOD"] == "POST") {
$_SESSION["eCartCheckoutForm_state_province"] = "".((isset($_POST["state_province"]))?$_POST["state_province"]:"") ."";
}
?>
<?php
if (!session_id()) session_start();
if($_SERVER["REQUEST_METHOD"] == "POST") {
$_SESSION["eCartCheckoutForm_country"] = "".((isset($_POST["country"]))?$_POST["country"]:"") ."";
}
?>
<?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 = 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
}
$Shipping_Counter++;
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"])) {
WA_eCart_UPS_SetSessionDefaults($eCart1);
}
?>
<?php
if ($eCart1->IsEmpty()) {
$eCart1->redirStr = "cart.php";
$eCart1->cartAction = "RedirectIfEmpty";
}
?><?php
// WA eCart Redirect
if ($eCart1->redirStr != "") {
header("Location: ".$eCart1->redirStr);
}
?>
<?php
require_once("WA_eCart/checkoutScripts/WA_simlib.php");
?>

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