♥kymation Posted November 3, 2013 Posted November 3, 2013 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 Quote See my profile for a list of my addons and ways to get support.
triode Posted November 3, 2013 Posted November 3, 2013 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. Quote
negativeexistence Posted November 9, 2013 Posted November 9, 2013 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 Quote
♥kymation Posted November 9, 2013 Posted November 9, 2013 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 Quote See my profile for a list of my addons and ways to get support.
negativeexistence Posted November 9, 2013 Posted November 9, 2013 Thanks Jim! I hope USPS irons this out soon! Quote
dculley Posted November 9, 2013 Posted November 9, 2013 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. Quote
dculley Posted November 9, 2013 Posted November 9, 2013 Jim my line 411 reads: $response_array = json_decode(json_encode(simplexml_load_string($body)), TRUE); if that helps any. Quote
♥kymation Posted November 9, 2013 Posted November 9, 2013 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 Quote See my profile for a list of my addons and ways to get support.
brettmb Posted November 9, 2013 Posted November 9, 2013 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. Quote
Guest Posted November 9, 2013 Posted November 9, 2013 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. Quote
♥kymation Posted November 9, 2013 Posted November 9, 2013 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 Quote See my profile for a list of my addons and ways to get support.
brettmb Posted November 9, 2013 Posted November 9, 2013 I went with a different function to read the api. It removed those characters, but my GetXMLTree function is still returning an error. Quote
brettmb Posted November 9, 2013 Posted November 9, 2013 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. Quote
negativeexistence Posted November 9, 2013 Posted November 9, 2013 (edited) 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 November 9, 2013 by negativeexistence Quote
brettmb Posted November 9, 2013 Posted November 9, 2013 I'm not sure, but I think they may have changed a |"| to a |" | in the xml tag. Quote
AllThingsTrendy Posted November 10, 2013 Posted November 10, 2013 (edited) 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 November 10, 2013 by AllThingsTrendy Quote Anthony David AllThingsTrendy.com
♥kymation Posted November 10, 2013 Posted November 10, 2013 (edited) 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\>\®\<\/sup\>/', '/\<sup\>\™\<\/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 November 10, 2013 by kymation Quote See my profile for a list of my addons and ways to get support.
negativeexistence Posted November 10, 2013 Posted November 10, 2013 @@kymation - you are amazing! THANKS!!! Quote
dculley Posted November 10, 2013 Posted November 10, 2013 I applied the above and the USPS shipping came back up. But it is not picking up handling charges. Quote
♥kymation Posted November 10, 2013 Posted November 10, 2013 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 Quote See my profile for a list of my addons and ways to get support.
♥kymation Posted November 10, 2013 Posted November 10, 2013 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 Quote See my profile for a list of my addons and ways to get support.
dculley Posted November 10, 2013 Posted November 10, 2013 I wasn't holding my toung to the left side. It is working now. :) Thanks Jim Quote
♥kymation Posted November 10, 2013 Posted November 10, 2013 And here I thought that I needed to sacrifice a chicken to make this work. It was a tasty dinner though. Regards Jim Quote See my profile for a list of my addons and ways to get support.
mabiem Posted November 10, 2013 Posted November 10, 2013 (edited) My code is very different. Having the server issue as well. Edited November 10, 2013 by mabiem Quote
mabiem Posted November 10, 2013 Posted November 10, 2013 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; */ Quote
Recommended Posts
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.