Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Recommended Posts

Posted

i have registered with USPS and have a Web Tools User ID which i've entered in the Administration settings for the USPS shipping module. i was not given a password, so the password is set to NONE. i've also called USPS to activate my User ID for production testing, a la the suggestions in http://www.oscommerce.com/forums/index.php?showtopic=202639&hl= . however, i am still getting the generic error output for USPS shipping:

 

"An error occured with the USPS shipping calculations.

If you prefer to use USPS as your shipping method, please contact the store owner."

 

i've grep-ed this text in the code and don't see an easy means of getting further debugging information. the relevant section is from catalog/includes/modules/shipping/usps.php:

 

$uspsQuote = $this->_getQuote();

 

if (is_array($uspsQuote)) {

...

} else {

$this->quotes = array('module' => $this->title,

'error' => MODULE_SHIPPING_USPS_TEXT_ERROR); // this is line 111

}

 

so it appears that _getQuote() fails to return an array.

 

just yesterday i got the UPS XML Rates and Services v1.0 module working. although i got errors initially, the wonderful debugging statements that are included with the module allowed me to quickly resolve the issues i was having. is there something similar for the USPS module? if not, i would appreciate advice on how to proceed.

 

cheers,

jake

Posted

ah, nothing quite like replying to your own post :). a bit of additional investigation has shown that although i have the USPS module set to use the production server under the admin widget that the testing server is being contacted. i have ascertained this by doing a tcpdump on the server and see

 

19:48:00.285975 server.mysite.com.14348 > testing.shippingapis.com.www: S [tcp sum ok] 1219235358:1219235358(0) win 16384 <mss 1460,nop,nop,sackOK,nop,wscale 0,nop,nop,timestamp 1395046662 0> (DF) (ttl 64, id 54682, len 64)

19:48:00.304253 testing.shippingapis.com.www > server.mysite.com.14348: S [tcp sum ok] 1104184358:1104184358(0) ack 1219235359 win 8190 <mss 1460> (DF) (ttl 242, id 57453, len 44)

19:48:00.304431 server.mysite.com.14348 > testing.shippingapis.com.www: . [tcp sum ok] ack 1 win 16384 (DF) (ttl 64, id 63253, len 40)

 

any advice on fixing this anomalous behavior? i'll restart apache and see if i can fish up what's going on from the code if simple solutions continue to fail.

Posted

figured out what the problem was after i took a look at http://www.oscommerce.com/community/bugs,2...pping%2BModules :

(this one is near the bottom)

 

5 Apr 2006 03:05:15 patrick (AT) interpac (DOT) net

 

You need to have your zip code entered in the Admin Configuration>Shipping/Packaging>postal code field.

 

You need to contact USPS to request to switch your account to "production server" by email or calling them. Be sure to mension that you are using a shopping cart and you dont need to use the "testing server".

 

The only way it worked for me was with my USPS User ID and left the password blank, and set it on the production server.

 

I hope this saves someone like me time to figure this out.

 

having set this zipcode fixed all problems. does anyone think it's a good idea to add some debugging outputs that indicate this needs to be set? i wasted a substantial amount of time trying to figure this one out, and if others have done the same i'll try to whip up some code to submit.

Posted
figured out what the problem was after i took a look at http://www.oscommerce.com/community/bugs,2...pping%2BModules :

having set this zipcode fixed all problems. does anyone think it's a good idea to add some debugging outputs that indicate this needs to be set? i wasted a substantial amount of time trying to figure this one out, and if others have done the same i'll try to whip up some code to submit.

 

Just wanted to let you know that talking to yourself is not necessarily a waste of time.

 

You saved me lots of time. I had the same problem. Had been trying to get USPS working for a while w/o success. Read your posts, called USPS to switch to production service ... and w/o any other chagnes on my part... it worked.

 

Thanx.

 

ezjam

Posted

I still have yet to call/email USPS, but I do have my ID set, password field blank....

 

However, I might be a bit different from you two - I am using the Multi Vendor Shipping - and have 2 vendors that are using USPS solely.

 

If I set my zip code in the admin section, it won't be correct since no products will be shipped from my location.

 

Any suggestions?

Posted

you will have to change the usps in function _getQuote:

 

					  '<ZipOrigination>' . SHIPPING_ORIGIN_ZIP . '</ZipOrigination>' .

 

You could enhance the vendors sql table to include an extra column as their zip code of origin. Not sure what add-ons are available for the vendors contribution if any that could assist you. Then you have a products to vendors table therefore you could pull the particular vendor and consequently the zip code of origin.

 

Since the customer may able to add products from multiple vendors in the cart, further changes needed to generate separate USPS quotes based on the vendor's origin. This part of the code should likely deployed in the function quote() and the results should be added to prior displaying the total shipping amount to the customer.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...