Jump to content
fulluvscents

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

Recommended Posts

@@aerosmith

 

Hi, did you sign up for an account at USPS.com? I noticed when I installed it I did not get any rates until I called them and told me to put me on the production server. According to the emails they sent me they start everybody out on the test server.

Edited by NodsDorf

Share this post


Link to post
Share on other sites

I'm sure this may have been rehashed before, but here is my issue:

 

In the Admin Panel, the choices do not remained checked, but the first check box has part of "Array" listed in it. In the actual listing, no choices show up. No errors are listed, so I believe that USPS servers are being contacted correctly. Any Ideas?

Share this post


Link to post
Share on other sites

@@pvoce

Did you uninstall the stock oscommerce usps module before installing this one? Also which method did you use, drop on top, or self modify files?

 

Your problem sounds like some data in this database wasn't cleared or ther is a missing character in the code.

 

I don't know if there are any people who had this problem 14 pages is hard to read through, but I can say I did not have that issue.

 

I can try and help if you want to answer those questions or show a screen shot of what the problem looks like.

Share this post


Link to post
Share on other sites

@@pvoce

Did you uninstall the stock oscommerce usps module before installing this one? Also which method did you use, drop on top, or self modify files?

 

Your problem sounds like some data in this database wasn't cleared or ther is a missing character in the code.

 

I don't know if there are any people who had this problem 14 pages is hard to read through, but I can say I did not have that issue.

 

I can try and help if you want to answer those questions or show a screen shot of what the problem looks like.

 

I did uninstall the stock version (it only gave me the "library mail" option) before dropping in the Restrict Methods catalog folder, along with some minor adding/editing to the ..admin/includes/includes/functions/general.php file. I did also run the sql query (just ran it again, just to be sure).

 

Any other places I should look in particular?

Share this post


Link to post
Share on other sites

@@pvoce

I see, looks like you went for the last version that had all the frills, I actually installed the version before that. Aside from not getting flat rate values returned from USPS it is working well.

USPS Rate V4 Intl Rate V2 - v.1.7 - FIX 11 Feb 2012

 

Maybe somebody else can lend a hand, or if you don't actually need the product restrict functionality you could use the version above.

Share this post


Link to post
Share on other sites

Greetings. Our website is: www.uncleharrys.com. I've been running USPS Rate V4 Intl Rate V2 - v.1.7 with no issues. Suddenly today, checkout_shipping.php times out. Here's the message:

 

Gateway Time-out

The gateway did not receive a timely response from the upstream server or application.

 

I've sent an email to USPS Webtools inquiring to see if my Webtools ID was in good standing, or if there was any change that could be creating this issue.

 

Anybody have any ideas?

 

THANK YOU!

Edited by nitaig

Share this post


Link to post
Share on other sites

I am running USPS Rate V4 Intl Rate V2 - v.1.7 on recent clean installation of OSC 2.3.3. I have the boxes checked for six international shipping options. However, customers with addresses outside the USA are not getting any USPS shipping options offered. There isn't even a USPS section during checkout. Domestic customers (in the USA) are getting the expected options.

 

Any guesses about what is going wrong or how to troubleshoot?

Share this post


Link to post
Share on other sites

Okay, it looks like this problem results from unescaped ampersands in the data returned by USPS for international addresses along with incomplete handling of the returned data. As a quick (and fairly kludgey) fix, I added an extra pass at replacing them before returning the data on line 249:

 

$body = preg_replace('/&[^; ]{0,6}.?/e', "((substr('\\0',-1) == ';') ? '\\0' : '&'.substr('\\0',1))", $body);

Share this post


Link to post
Share on other sites

@@pvoce

I see, looks like you went for the last version that had all the frills, I actually installed the version before that. Aside from not getting flat rate values returned from USPS it is working well.

USPS Rate V4 Intl Rate V2 - v.1.7 - FIX 11 Feb 2012

 

Maybe somebody else can lend a hand, or if you don't actually need the product restrict functionality you could use the version above.

 

I went ahead and "started over" and added the V4 2/12 module, and is working great, save for no international options are appearing. I'm reading back to see if anyone has run into this before I add the add on

Share this post


Link to post
Share on other sites

Okay, it looks like this problem results from unescaped ampersands in the data returned by USPS for international addresses along with incomplete handling of the returned data. As a quick (and fairly kludgey) fix, I added an extra pass at replacing them before returning the data on line 249:

 

$body = preg_replace('/&[^; ]{0,6}.?/e', "((substr('\\0',-1) == ';') ? '\\0' : '&'.substr('\\0',1))", $body);

 

Pardon my naivete, but in which file did you add the code? Thanks:)

Share this post


Link to post
Share on other sites

Pardon my naivete, but in which file did you add the code? Thanks:)

 

My apologies for the lack of clarity. That would be includes/modules/shipping/usps.php. The relevant modified section looks like this:

 

   	 if ($http->Connect('production.shippingapis.com', 80))
           {
           $http->addHeader('Host', 'production.shippingapis.com');
           $http->addHeader('User-Agent', 'osCommerce');
           $http->addHeader('Connection', 'Close');
           if ($http->Get('/shippingapi.dll?' . $request)) $body = preg_replace(array('/\<sup\>\&reg;\<\/sup\>/', '/\<sup\>\&trade;\<\/sup\>/', '/\" /', '/\",/', '/\"<br>/', '/<br>/'), array('RM', 'TM', '",', '" ', '"<br>', 'BREAK'), htmlspecialchars_decode($http->getBody()));
//            mail(STORE_OWNER_EMAIL_ADDRESS, STORE_OWNER, $body);
           $http->Disconnect();
	    $body = preg_replace('/&[^; ]{0,6}.?/e', "((substr('\\0',-1) == ';') ? '\\0' : '&'.substr('\\0',1))", $body);
	    return json_decode(json_encode(simplexml_load_string($body)),TRUE);
           }

 

This could likely be combined into the earlier preg_replace (for increased efficiency) by someone with more patience (like the package maintainer).

Share this post


Link to post
Share on other sites

Just out of curiosity, is the reason that Intl Rates are not appearing in checkout due to the fact that I am in the US, or should they be visible as options? They are selected in admin/modules/shipping/usps, so they should be offered.

Share this post


Link to post
Share on other sites

They should be visible for you during checkout if the shipping address is outside of the USA. I have a normal user account for testing on my OSC installation with multiple shipping addresses, including on in Canada, some in Europe, some in Asia, etc.

Share this post


Link to post
Share on other sites

hi guys

 

im all new to this so ill get straight to the point, im trying to install the UPSXML_v1_4_0_1 module, i have updated the sql file and placed all the files in the relevent folders now i keep getting the errors

 

Warning: require_once(includes/classes/xml_5.php) [function.require-once]: failed to open stream: No such file or directory in /home/*******/public_html/******.com/includes/modules/shipping/upsxml.php on line 25

 

 

 

Fatal error: require_once() [function.require]: Failed opening required 'includes/classes/xml_5.php' (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/*******/public_html/*******.com/includes/modules/shipping/upsxml.php on line 25

 

 

this is the line 23-28

 

// Incorporate the XML conversion library

if (PHP_VERSION >= '5.0.0') { // PHP 5 does not need to use call-time pass by reference

require_once (DIR_WS_CLASSES . 'xml_5.php');

} else {

require_once (DIR_WS_CLASSES . 'xml.php');

}

 

any help

 

thanks

Share this post


Link to post
Share on other sites

hi guys

 

im all new to this so ill get straight to the point, im trying to install the UPSXML_v1_4_0_1 module, i have updated the sql file and placed all the files in the relevent folders now i keep getting the errors

 

Warning: require_once(includes/classes/xml_5.php) [function.require-once]: failed to open stream: No such file or directory in /home/*******/public_html/******.com/includes/modules/shipping/upsxml.php on line 25

 

 

 

Fatal error: require_once() [function.require]: Failed opening required 'includes/classes/xml_5.php' (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/*******/public_html/*******.com/includes/modules/shipping/upsxml.php on line 25

 

 

this is the line 23-28

 

// Incorporate the XML conversion library

if (PHP_VERSION >= '5.0.0') { // PHP 5 does not need to use call-time pass by reference

require_once (DIR_WS_CLASSES . 'xml_5.php');

} else {

require_once (DIR_WS_CLASSES . 'xml.php');

}

 

any help

 

thanks

 

Have you added the following to your catalog directory?:

 

catalog/admin/includes/classes/xml.php

catalog/admin/includes/classes/xml_5.php

catalog/includes/classes/xml.php

catalog/includes/classes/xml_5.php

catalog/includes/languages/english/modules/shipping/upsxml.php

catalog/includes/modules/shipping/upsxml.php

Share this post


Link to post
Share on other sites

Hi to all of you Guys.

 

I'm developing my store. It's not online at this moment but is ready to be operational. The only thing that keep me from put it online is a problem with this shipping module. Help is needed. So, Straigth to the point... I want to offer Express Mail Service, Priority Service, Medium Flat Service, Priority Regional Service A & B and First Class Mail Service at least for domestic shipping. I can't offer Priority Medium Flat Rate Box and Priority Regional Service A. The store return a error message that said: " -2147219085 Invalid XML Element content is incomplete according to the DTD/Schema. line= 0 pos= 1668" for Priority Medium Flat Rate and Regional A Box Service. All other service are offered without any problem. Any idea what should be the problem?

 

note: I contacted USPS and they told me my account and their system is working properly.

 

Thanks for any help

Edwin

Share this post


Link to post
Share on other sites

Everything looks ok to me on the admin side but USPS is not showing up as a option on checkout.

What might cause that to happen?

Share this post


Link to post
Share on other sites

Everything looks ok to me on the admin side but USPS is not showing up as a option on checkout.

What might cause that to happen?

assuming you have the module enabled and have a usps account user id in place on the admin side, look at the sort order if you have any other options enabled. if there are more than one shipping option, try different sort orders. other than that, i'm out of ideas.


I am not a professional webmaster or PHP coder by background or training but I will try to help as best I can.

I remember what it was like when I first started with osC. It can be overwhelming.

However, I strongly recommend considering hiring a professional for extensive site modifications, site cleaning, etc.

There are several good pros here on osCommerce. Look around, you'll figure out who they are.

Share this post


Link to post
Share on other sites

I only received my first login email from usps. I didn't get the second approval yet.

But would that make it not even show up as an option at all?

Share this post


Link to post
Share on other sites

I only received my first login email from usps. I didn't get the second approval yet.

But would that make it not even show up as an option at all?

 

it's been some years now since i set up our usps account so i don't recall the particulars, buy i can see where if your shop isn't communicating with the usps server, there may be code written in the add on that would hide usps because it's not showing valid info. that's my hunch anyway.

 

also, make sure you did this step from the install instructions:

 

USPS offers no test server for this API syntax. After you have registered

with USPS and received your user ID, you must email USPS per instructions

in the email from them, and ask them to switch you over to the production

Mention that you are using OSCommerce. If you haven't received a reply within

24 hours, then email a second time and ensure them that your script has been

tested and is ready to go live. Or just call them.


I am not a professional webmaster or PHP coder by background or training but I will try to help as best I can.

I remember what it was like when I first started with osC. It can be overwhelming.

However, I strongly recommend considering hiring a professional for extensive site modifications, site cleaning, etc.

There are several good pros here on osCommerce. Look around, you'll figure out who they are.

Share this post


Link to post
Share on other sites

Hi. I installed this useful module. It is working great on my OSC 2.3.3 store. Just a question. It is just me (my API account or something else), that I see the different options, (just name of the shipping option and RATE), But I don't see the Estimated DELIVERY DAYS. Is that a feature that USPS is not showing via API anymore? or it is this ADDON USPS Rates V4 missing part or maybe I missed something when I installed it?

 

Please, I will appreciate a response to this one.

 

Thanks

 

Danny.

Share this post


Link to post
Share on other sites

it's been some years now since i set up our usps account so i don't recall the particulars, buy i can see where if your shop isn't communicating with the usps server, there may be code written in the add on that would hide usps because it's not showing valid info. that's my hunch anyway.

 

also, make sure you did this step from the install instructions:

 

Yes this was the problem.

I called and got them to switch it to production and now I can see the USPS option on checkout.

Thank you.

Share this post


Link to post
Share on other sites

Yes this was the problem.

I called and got them to switch it to production and now I can see the USPS option on checkout.

Thank you.

 

You're welcome and I am glad that worked out.


I am not a professional webmaster or PHP coder by background or training but I will try to help as best I can.

I remember what it was like when I first started with osC. It can be overwhelming.

However, I strongly recommend considering hiring a professional for extensive site modifications, site cleaning, etc.

There are several good pros here on osCommerce. Look around, you'll figure out who they are.

Share this post


Link to post
Share on other sites

Hi, I really could use some help I down loaded this program and I get library mail when I do a test run. And does anyone know how to change the weight to gram's the product I am selling starts as low as 1/3 of a gram. Any help would be very much appreciated. Thanks

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

×