Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

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


Guest

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.

Link to comment
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.

Link to comment
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

Link to comment
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.

Link to comment
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.

Link to comment
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.

Link to comment
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.

Link to comment
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.

Link to comment
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.

Link to comment
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

[email protected]

Edited by negativeexistence
Link to comment
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

Link to comment
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.

Link to comment
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.

Link to comment
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.

Link to comment
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;

*/

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

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