close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

eCart 4.5.2 Shipping Configured For USPS

Thread began 3/06/2010 1:51 pm by online.order393818 | Last modified 3/08/2010 5:39 pm by Jason Byrnes | 2109 views | 7 replies |

online.order393818

eCart 4.5.2 Shipping Configured For USPS

If there is anyone that is currently using eCart 4.5.2, and has successfully configured your cart.php page, or checkout.php for USPS. I would appreciate it greatly if you would share your code with me.

I have been trying to configure my cart to use USPS for shipping for the past month without success.

The problem I'm have is that for (1) item that cost $4.99 with a weight of (2) ounces the shipping calculation using First Class is costing $18.86.

I have exhausted all the possible resources presented to me here at Web Assist Forum Support to no avail.

Thank you,
Jw

Sign in to reply to this post

Jason ByrnesWebAssist

The shipping code generated for me when usig the checkout wizard looks like:


php:
<?php

//WA eCart UPS Shipping Include
require_once("WA_eCart/WA_eCart_USPS_PHP.php");
?>
<?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"] = "########";
  
$Shipping_Parameters["USPSServer"] = "http://production.shippingapis.com/shippingapi.dll";
  
$Shipping_Parameters["CarrierCode"] = "FIRST CLASS";
  
$Shipping_Parameters["DefaultIntl"] = "none";
  
$Shipping_Parameters["ShipperZip"] = "92102";
  while ((
$Shipping_Packaging == && !$eCart1->EOF()) || ($Shipping_Packaging == && $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)?$eCart1->DisplayInfo("Quantity"):1);
      
$Shipping_PackageArray[$Shipping_PackageIndex]["IsPackage"] = "true";
      
$Shipping_PackageArray[$Shipping_PackageIndex]["Quantity"] = "".WA_eCart_FormatNumber($eCart1->DisplayInfo('Quantity'), true1)  ."";
      
$Shipping_PackageArray[$Shipping_PackageIndex]["WeightUnits"] = "OZ";
      
$Shipping_PackageArray[$Shipping_PackageIndex]["PackageWeight"] = "".WA_eCart_FormatNumber($eCart1->TotalColumn('TotalWeight'), true1)  ."";
      
$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$eCart1->MoveNext();
  }
  if (
$Shipping_Packaging == 1$eCart1->MoveFirst();
  
$Shipping_Result WA_eCart_USPS_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); exit;
  }
}
else if (!isset(
$_SESSION["eCart1_USPS_Success"])) {
  
WA_eCart_USPS_SetSessionDefaults($eCart1);
}
?>




this is using a cart name eCart1. The shipping rate is determined by starting and ending zip code as well as weight.


to get some information on why you are getting the shipping rate, try adding the following ode on the confirm page in the bady:

php:
<?php 

if(!session_id()) session_start();
echo(
"<br />Full Request: ".htmlentities($_SESSION["<your cart name>_USPS_FullRequest"]));
echo(
"<br />Full Response: "htmlentities($_SESSION["<your cart name>_USPS_FullResponse"]));
?>




substitute:
<your cart name>

for the name of your cart object. This will tell us what is being sent to USPS and what us being sent back.

Sign in to reply to this post

online.order393818

eCart 4.5.2 Shipping Configured For USPS

Jason,

Thanks for your response. I'll compare it to my code and see what happen. I had already earlier compared my code to that of 'ryanteete 270615' from a thread posted earlier by this memeber, but that didn't work for me either!

Jw

Sign in to reply to this post

Jason ByrnesWebAssist

perhaps if you could post your code, as well as the results of the Full Request and Full response code I supplied, I could see what is going wrong.

Sign in to reply to this post

online.order393818

eCart 4.5.2 Shipping Configured For USPS

Jason,

I tested the new code, and the shipping price is still too high. 1 item, totalweight 2 oz, shippng cost $12.02.

Based on origin & destination the cost should be no more than $2.50 using USPS First Class.
I've attach a zip file with 3 gif images for you to take a look at as well as the code from my checkout.php file.

Thank you,
Jw

Attached Files
S_Forum.zip
Sign in to reply to this post

Jason ByrnesWebAssist

the shipping code looks correct to me.

Hmmmm, thats strange, the request and response from USPS are not coming through. Try using this code instead:

php:
<?php  

if(!session_id()) session_start(); 
echo(
"<br />Full Request: ".$_SESSION["Kyla_USPS_FullRequest"]); 
echo(
"<br />Full Response: "$_SESSION["Kyla_USPS_FullResponse"]); 
?>





If the Request and response are still not coming through, please send a copy of your WA_eCart folder.

Sign in to reply to this post

online.order393818

eCart 4.5.2 Shipping Configured For USPS

Jason,

I got a response from USPS server this time. The shipping quote is still the same naturally, no re-config was done to the code except change the request & response code.

I've attached 1 gif, and the WA_eCart directory.

Jw

Attached Files
S_Forum2.zip
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:
login.php

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