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

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

UPS: S is not a valid unit of measurement for weight for this shipment

Thread began 12/02/2011 11:20 am by eric284736 | Last modified 6/19/2012 7:11 pm by graham | 1738 views | 10 replies |

eric284736

UPS: S is not a valid unit of measurement for weight for this shipment

Hi,

I have run thru the checkout wizard setting up the UPS shipping and I am getting this error when checking out.

S is not a valid unit of measurement for weight for this shipment

This is cart 5.03.

thx
Eric

Sign in to reply to this post

eric284736

Here is the UPS code

<?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["UserID"] = "floralartla";
$Shipping_Parameters["Password"] = "sXXXXXX";
$Shipping_Parameters["AccessKey"] = "XXXXX";
$Shipping_Parameters["CarrierCode"] = "03";
$Shipping_Parameters["PickupType"] = "01";
$Shipping_Parameters["CustomerClass"] = "none";
$Shipping_Parameters["ShipperNumber"] = "";
$Shipping_Parameters["ShipperCity"] = "Venice";
$Shipping_Parameters["ShipperState"] = "California";
$Shipping_Parameters["ShipperZip"] = "90291";
$Shipping_Parameters["ShipperCountry"] = "US";
$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"]:"") ."";
while (($Shipping_Packaging == 1 && !$productcart->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)?$productcart->DisplayInfo("Quantity"):1);
$Shipping_PackageArray[$Shipping_PackageIndex]["IsPackage"] = "true";
$Shipping_PackageArray[$Shipping_PackageIndex]["Quantity"] = "".WA_eCart_FormatNumber($productcart->DisplayInfo('Quantity'), true, 1) ."";
$Shipping_PackageArray[$Shipping_PackageIndex]["WeightUnits"] = "".strtoupper($productcart->WeightUnits)."S" ."";
$Shipping_PackageArray[$Shipping_PackageIndex]["PackageWeight"] = "".$productcart->DisplayInfo("TotalWeight") ."";
$Shipping_PackageArray[$Shipping_PackageIndex]["PackageType"] = "02";
$Shipping_PackageArray[$Shipping_PackageIndex]["SizeUnits"] = "IN";
$Shipping_PackageArray[$Shipping_PackageIndex]["PackageLength"] = "24";
$Shipping_PackageArray[$Shipping_PackageIndex]["PackageWidth"] = "24";
$Shipping_PackageArray[$Shipping_PackageIndex]["PackageHeight"] = "24";
//Special Services
}
$Shipping_Counter++;
if ($Shipping_Packaging == 1) $productcart->MoveNext();
}
if ($Shipping_Packaging == 1) $productcart->MoveFirst();
$Shipping_Result = WA_eCart_UPS_GetRateQuote($productcart, $Shipping_Parameters, $Shipping_PackageArray);
if ($Shipping_Result && $Shipping_SuccessURL != "")
$productcart->redirStr = $Shipping_SuccessURL;
else if (!$Shipping_Result && $Shipping_FailureURL != "") {
Header("Location: " . $Shipping_FailureURL); exit;
}
}
else if (!isset($_SESSION["productcart_UPS_Success"])) {
WA_eCart_UPS_SetSessionDefaults($productcart);
}
?>

Sign in to reply to this post

Jason ByrnesWebAssist

change this line:

php:
$Shipping_PackageArray[$Shipping_PackageIndex]["WeightUnits"] = "".strtoupper($productcart->WeightUnits)."S" ."";



to:

php:
$Shipping_PackageArray[$Shipping_PackageIndex]["WeightUnits"] = "".strtoupper($productcart->WeightSuffix)."S" ."";
Sign in to reply to this post

eric284736

Thanks Jason, Done.

Now it is giving me the error:

California is not a valid state for the specified shipment.

That is the selected state that it is shipping from.

thx
Eric

Sign in to reply to this post

eric284736

Hi Jason,

I removed the UPS behavior and reapplied. Tested with the original code and got the same error.

Replaced the code line with what you supplied and I get the following error:

1S is not a valid unit of measurement for weight for this shipment

Here is the current code in place:

<?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["UserID"] = "floralartla";
$Shipping_Parameters["Password"] = "XXXXXX";
$Shipping_Parameters["AccessKey"] = "4C40XXXXXXXX";
$Shipping_Parameters["CarrierCode"] = "03";
$Shipping_Parameters["PickupType"] = "01";
$Shipping_Parameters["CustomerClass"] = "04";
$Shipping_Parameters["ShipperNumber"] = "";
$Shipping_Parameters["ShipperCity"] = "Venice";
$Shipping_Parameters["ShipperState"] = "CA";
$Shipping_Parameters["ShipperZip"] = "90291";
$Shipping_Parameters["ShipperCountry"] = "US";
$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"] = "US";
while (($Shipping_Packaging == 1 && !$productcart->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)?$productcart->DisplayInfo("Quantity"):1);
$Shipping_PackageArray[$Shipping_PackageIndex]["IsPackage"] = "true";
$Shipping_PackageArray[$Shipping_PackageIndex]["Quantity"] = "".WA_eCart_FormatNumber($productcart->DisplayInfo('Quantity'), true, 1) ."";
$Shipping_PackageArray[$Shipping_PackageIndex]["WeightUnits"] = "".strtoupper($productcart->WeightSuffix)."S" ."";
$Shipping_PackageArray[$Shipping_PackageIndex]["PackageWeight"] = "".$productcart->DisplayInfo("TotalWeight") ."";
$Shipping_PackageArray[$Shipping_PackageIndex]["PackageType"] = "02";
$Shipping_PackageArray[$Shipping_PackageIndex]["SizeUnits"] = "IN";
$Shipping_PackageArray[$Shipping_PackageIndex]["PackageLength"] = "24";
$Shipping_PackageArray[$Shipping_PackageIndex]["PackageWidth"] = "24";
$Shipping_PackageArray[$Shipping_PackageIndex]["PackageHeight"] = "24";
//Special Services
}
$Shipping_Counter++;
if ($Shipping_Packaging == 1) $productcart->MoveNext();
}
if ($Shipping_Packaging == 1) $productcart->MoveFirst();
$Shipping_Result = WA_eCart_UPS_GetRateQuote($productcart, $Shipping_Parameters, $Shipping_PackageArray);
if ($Shipping_Result && $Shipping_SuccessURL != "")
$productcart->redirStr = $Shipping_SuccessURL;
else if (!$Shipping_Result && $Shipping_FailureURL != "") {
Header("Location: " . $Shipping_FailureURL); exit;
}
}
else if (!isset($_SESSION["productcart_UPS_Success"])) {
WA_eCart_UPS_SetSessionDefaults($productcart);
}
?>

Sign in to reply to this post

eric284736

Hi Jason, perhaps we need to open a ticket on this? I need to get the UPS function working because it is a live site taking orders.

thx
Eric

Sign in to reply to this post

Jason ByrnesWebAssist

I have created a support ticket so we can look into this issue further.

To view and edit your support ticket, please log into your support history:
supporthistory.php

If anyone else is experiencing this same issue, please append to this thread.

Sign in to reply to this post

eric284736

Thanks Jason and Ray!!

All is fixed.

This looks like the cart definition did not update when I updated the cart version so Ray fixed the code entry and all is well!

Sign in to reply to this post

graham

Wondering what the verdict on this was ...

Jason (webassist), this thread, and the outcome, relates to a current hurdle I have come upon. I also had the "S is not a valid unit of measure" error. I followed your instruction to edit the WeightUnits/WeightSuffix, which produced a "GS is not a valid unit of measurement for weight for this shipment" error, similar error to eric's "1S". Was the final remedy one that might resolve my issue, or were there other contributing factors in eric's code that needed sorting out? If the later, what would you need to see to assess my problem?

I know you guys are supppppeeeerrrrr busy ... thanks for always taking the time to help us all out!

Sign in to reply to this post

Jason ByrnesWebAssist

I have created a support ticket so we can look into this issue further.

To view and edit your support ticket, please log into your support history:
supporthistory.php

If anyone else is experiencing this same issue, please append to this thread.

Sign in to reply to this post
loading

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