Jump to content
fulluvscents

USPS Rate V4, Intl Rate V2 (official support thread)

Recommended Posts

It sounds like you still have the old module. Uninstall it, then delete everything from includes/modules/ that has USPS in the name, then upload this module again. That should give you only the new module options.

 

Regards

Jim


See my profile for a list of my addons and ways to get support.

Share this post


Link to post
Share on other sites

It sounds like you still have the old module. Uninstall it, then delete everything from includes/modules/ that has USPS in the name, then upload this module again. That should give you only the new module options.

 

Regards

Jim

 

Huh, that fixed it. Something was not getting deleted when I uploaded it previously. This time I backed up the files and deleted

them from the server, then replaced them with the package. Thanks for the help.

Share this post


Link to post
Share on other sites

Everything has been working up until now. I am getting the following warnings:

 

 

Warning: simplexml_load_string() [function.simplexml-load-string]: Entity: line 1: parser error : Start tag expected, '<' not found in /home/negative/public_html/includes/modules/shipping/usps.php on line 390

 

Warning: simplexml_load_string() [function.simplexml-load-string]: 27 in /home/negative/public_html/includes/modules/shipping/usps.php on line 390

 

Warning: simplexml_load_string() [function.simplexml-load-string]: ^ in /home/negative/public_html/includes/modules/shipping/usps.php on line 390

Share this post


Link to post
Share on other sites

That sounds like the USPS server is returning an invalid response. I just checked a couple of sites that use this module, and they're all not returning any quotes. This probably means the USPS server is broken. Again.

 

Regards

Jim


See my profile for a list of my addons and ways to get support.

Share this post


Link to post
Share on other sites

Just checked my site and I'm getting basicly the same errors:

 

Warning: simplexml_load_string() [function.simplexml-load-string]: Entity: line 1: parser error : Start tag expected, '<' not found in /home/content/l/a/d/lady3597/html/includes/modules/shipping/usps.php on line 411

 

Warning: simplexml_load_string() [function.simplexml-load-string]: 27 in /home/content/l/a/d/lady3597/html/includes/modules/shipping/usps.php on line 411

 

Warning: simplexml_load_string() [function.simplexml-load-string]: ^ in /home/content/l/a/d/lady3597/html/includes/modules/shipping/usps.php on line 411

 

Hope they get this fixed soon also. Thanks Jim in advance.

Share this post


Link to post
Share on other sites

Jim my line 411 reads: $response_array = json_decode(json_encode(simplexml_load_string($body)), TRUE);

if that helps any.

Share this post


Link to post
Share on other sites

I just ran a quick test that sends a request for all services for a specific package. All the USPS server did was echo back the request. If that's what you are getting, I'm not surprised that the decoder is getting confused.

 

In any case, they are not returning quotes, and that's what matters.

 

Regards

Jim


See my profile for a list of my addons and ways to get support.

Share this post


Link to post
Share on other sites

I'm having a similar problem. I seem to be getting incorrect info returned:

 

27

<?xml version="1.0",encoding="UTF-8"?>

 

f8c

and more... these random bits seem to be what's screwing it up.

Share this post


Link to post
Share on other sites

I'm getting similar results. Called the USPS Web Tools number and was first told there was an upgrade and then told it wasn't a release because there was no notes, but rather it was a migration.

 

What is odd is that some of our websites are able to handle the USPS response but other sites are not - only one of our oscommerce websites appears to be unaffected.


Want A Better Website, Inc.

Share this post


Link to post
Share on other sites

I tried this again and got the response with invalid characters sprinkled through it. It's possible that only some of many USPS servers are returning invalid responses. I have no idea.

 

It could be possible to filter out this garbage, but it won't be easy. It would be better if USPS would follow their own API. I'm not going to hold my breath.

 

Regards

Jim


See my profile for a list of my addons and ways to get support.

Share this post


Link to post
Share on other sites

I went with a different function to read the api. It removed those characters, but my GetXMLTree function is still returning an error.

Share this post


Link to post
Share on other sites

I got it working, but I don't know if it will help others. My script did a preg_replace for quotes and other html characters. It didn't play nice with the opening xml tag. I removed that tag, did the preg_replace and then added it back before parsing the xml value. That did it for me.

Share this post


Link to post
Share on other sites

My fingers are crossed...

Dear Frederick,

We apologize for the difficulty that you have had with our server connectivity.

The issue is being investigated by network engineers and the website should be fully functional shortly.

We apologize for any inconvenience.

 

If you have any additional questions or concerns, please contact us again.

Thank you for emailing your Postal Service™,

 

Todd A

USPS Internet Customer Care Center

uspstechsupport@esecurecare.net

Edited by negativeexistence

Share this post


Link to post
Share on other sites

USPS just died on us today as well. It's amazing the Postal Service whack jobs want to increase our fees while services continue to degrade. It's no wonder they run $BILLONS in deficits each year!!! Curious, does this craziness also happen with the FedEx or UPS modules? I can't help but to vent... if we constantly impacted our customers in the way the USPS is constantly impacting all of us, we would have been fired long ago.... just sayin' !!! I hope it isn't the same team working on the Obama Care site... sounds possible. :x

 

I've got our sites setup with the Zone Rates shipping module, Table Rates module and the Per Item module just to be able to provide customers with a shipping option every time the USPS screws us over. I just wish those modules were a bit more flexible as they are very restrictive and I can only seem to have a single zone for the Zones Shipping module. Seems we should pull resources and improve that module so that everyone has a back-up shipping module to handle multiple countries during these emergencies.

 

Thanks to Jim and others for the continual updates and advice, as usual, I'll keep watching for update and suggestions. Perhaps we'll be up and running again soon! Thanks for letting me vent the frustration! (w00t)

Edited by AllThingsTrendy

Anthony David

AllThingsTrendy.com

Share this post


Link to post
Share on other sites

Finally! I've been playing whack-a-mole with the USPS server response. Multiple problems, and they're not consistent. Anyway, I have a fix that seems to work. Use at your own peril. Given that this is the USPS, I expect them to come up with a new bug any minute now.

 

Find this code in your usps.php module file (yours may be slightly different, but it will look like this:

 

	    $body = preg_replace( array(
	  '/\<sup\>\&reg;\<\/sup\>/',
	  '/\<sup\>\&trade;\<\/sup\>/',
	  '{<sup>®</sup>}',  /* Registered Trademark symbol - July 2013 update */
	  '{<sup>™</sup>}',  /* Trademark symbol - July 2013 update */
	  '/\" /',
	  '/\",/',
	  '/\"<br>/',
	  '/<br>/'
    ), array (
	  'RM',
	  'TM',
	  'RM',
	  'TM',
	  '",',
	  '" ',
	  '"<br>',
	  'BREAK'
    ), htmlspecialchars_decode($response));


 

and replace it with this:

 

 	    $body = preg_replace( array(
	  '/\v*[0-9a-f]+\v+/',
	  '{<sup>®</sup>}',  /* Registered Trademark symbol - July 2013 update */
	  '{<sup>™</sup>}',  /* Trademark symbol - July 2013 update */
	  '/\",/',
	  '/\"<br>/',
	  '/<br>/'
    ), array (
	  '',
	  'RM',
	  'TM',
	  '",',
	  '"<br>',
	  'BREAK'
    ), htmlspecialchars_decode($response));

 

Please let me know if this works for you. I've done limited testing because I wanted to get the fix out there as soon as possible.

 

@@AllThingsTrendy I have an equally low opinion of the USPS. Believe me. If you want a replacement, the MZMT module gives you table rates with multiple zones.

 

Regards

Jim

 

edit: Forum broke the PHP.

Edited by kymation

See my profile for a list of my addons and ways to get support.

Share this post


Link to post
Share on other sites

I applied the above and the USPS shipping came back up. But it is not picking up handling charges.

Share this post


Link to post
Share on other sites

The section that I changed doesn't have anything to do with the handling charges -- it's just a filter on what comes back from USPS. I'll take another look just in case.

 

Regards

Jim


See my profile for a list of my addons and ways to get support.

Share this post


Link to post
Share on other sites

I ran a test with a couple of different values for handling and they all worked. Check that you didn't make any other changes in your file, such as one of the arrays above the code I posted.

 

Regards

Jim


See my profile for a list of my addons and ways to get support.

Share this post


Link to post
Share on other sites

And here I thought that I needed to sacrifice a chicken to make this work.

 

It was a tasty dinner though.

 

Regards

Jim


See my profile for a list of my addons and ways to get support.

Share this post


Link to post
Share on other sites

My code is very different. Having the server issue as well.

Edited by mabiem

Share this post


Link to post
Share on other sites

Sorry this is it. It appears to be commented out.

 

//$qid = trim(preg_replace('/ +/', ' ', $body = preg_replace('/[^A-Za-z0-9 ]/', ' ', urldecode(html_entity_decode(strip_tags($tmpname))))));

 

$title = str_replace(' regimark','',$tmpname);

$title = str_replace(' tradmrk','',$title);

 

$title = str_replace('<sup>®</sup>','',$title);

$title = str_replace('<sup>™</sup>','',$title);

 

$title = str_replace(array(' 1-Day',' 2-Day',' 3-Day',' Military',' DPM'),'',$title);

$title = str_replace('sup/sup','',preg_replace('/&([^`]*?);/','',$title));

$qid = $title;

*/

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×