Jump to content
fulluvscents

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

Recommended Posts

Just upgraded one of my clients' osCommerce sites to the latest suggested patch that kymation posted... However, I didn't get any results for domestic shipping... :/

 

My client only wanted to offer "1st-Class Parcel" and "Standard Post" for domestic shipping options. I saw the note above that Standard Shipping was only for live animals (WTF?), so I disabled that option, but no luck.

 

When I enable all the domestic shipping options, only then did I get Media Mail, various Priority Mail, and various Priority Mail Express results. Convinced my client to add "Priority Mail" to their list...

 

I also noticed that the transit times aren't being shown anymore, and there isn't a config option to turn it back on -- was this removed/disabled for some particular reason?

Share this post


Link to post
Share on other sites

First Class Parcel is only available for shipments that weigh 13 ounces or less. Check that your item weight is less than this, and that your Tare settings are not raising the weight over this limit.

 

Priority is the preferred shipping method for USPS. As you noted, they are trying to get rid of Standard Post except for very limited uses.

 

Transit times are now buried in the service name. I'm going to try to put something back in for the new module, but this is not simple due to the USPS messing with the service names.

 

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

@@kymation I've followed this thread extensively and am getting the same simplexml errors others have posted. I've tried various fixes and am at the point where I have the latest version installed.

 

I'm on PHP 5.1.6

mySQL 5.0.95

osC 2.2 RC2a

 

If you can help me, I'd be thrilled. We've been pushing these guys to upgrade their store, but they won't budge. The issue is that we are dealing with a service provider to a larger company (who owns the store, ultimately).

Share this post


Link to post
Share on other sites

This module requires a minimum of PHP 5.2 to operate. Your version has a number of security flaws, so I cannot recommend that you try to run a store on that old PHP. Please upgrade to a newer version.

 

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 will work on 5.2.x with no problems, and on 5.3 with some upgrades/fixes.

 

osCommerce 2.2 RC2a is some really old code with a lot of security flaws and bugs. I suggest moving to the latest 2.3 version. That will also take care of the problems with PHP 5.3 and 5.4.

 

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've converted quite a few heavily modified stores. The new versions run better and are safer. The customers seem to like them as well.

 

I suggest starting with a fresh copy of the latest version of osCommerce and a new database. Install in a subdirectory. Ideally, set up a subdomain of your main site, but that is not essential.

 

You'll need to import your products and customers. This takes a bit of work the first time, but gets easier with practice.

 

Then start adding the addons and modifications that you need. Most of what you have is available in a 2.3 version or is easily modified to work with 2.3. As you look at each addon, decide whether it is something that is really needed or is used by customers. Skip the ones that are unwanted/unused. Once you have things running, you can set up a theme that fits your site. I used this opportunity to modernize some sites that looked outdated.

 

It does involve a bit of work, but you end up with a better store that looks more appealing to customers.

 

The only thing left to do then is keep up with osC releases so you never get that far behind 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

Hi Jim, I was just using the Create Order and after pulling up customer the next screen at the top gave me this missage.

Warning: Value is not properly chunk encoded in /home/content/l/a/d/lady3597/html/includes/modules/shipping/usps.php on line 663

Any ideas and how to fix it?

 

I don't use this mod very often so I don't know how long it has been a problem.

 

Dean

Share this post


Link to post
Share on other sites

That's just the USPS messing up again. It doesn't affect the quotes. If the warning bothers you, comment out the code -- there's a post about that back there a bit.

 

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

This may be of interest, it is based upon the module discussed here, detects whether or not to use CURL or HTTP_CLIENT:

 

http://www.codemehappy.com/2013/11/usps-fix-for-november-2013-for-oscommerce-based-carts/

 

I have used it with success - as of an hour ago


Follow the community build:

BS3 to osCommerce Responsive from the Get Go!

Check out the new construction:

Admin Gone to Total BS!

Share this post


Link to post
Share on other sites

The latest version posted here seems to be working, so I'm in no great hurry to change it. In any case, the code you linked to will work if cURL is installed, but still fails if it's not.

 

I have code that uses cURL if available and a new HTTP class (which works correctly with chunked output) if cURL is not installed. I'm using that in the new module. I would rather finish the new code than spend more time patching this one.

 

Feel free to upload this if you want to.

 

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

Jim I just wanted you to know. That I did tried today using the above from GL Walker and added in the "Restrict USPS Methods" part and all is working fine. It took care of the chunk error. Still looking forward to you new module. Thanks - Dean

Share this post


Link to post
Share on other sites

Hello,

When I altered my usps shipping info and selected save I get:

 

 

Warning: addslashes() expects parameter 1 to be string, array given in /home/negative/public_html/snowdenguitars/admin/modules.php on line 38

 

Warning: addslashes() expects parameter 1 to be string, array given in /home/negative/public_html/snowdenguitars/admin/modules.php on line 38

 

Warning: addslashes() expects parameter 1 to be string, array given in /home/negative/public_html/snowdenguitars/admin/modules.php on line 38

 

Warning: Cannot modify header information - headers already sent by (output started at /home/negative/public_html/snowdenguitars/admin/modules.php:38) in /home/negative/public_html/snowdenguitars/admin/includes/functions/general.php on line 34

 

I have uninstalled and reinstalled without any luck.

any ideas?

Thanks,

-Alex

Share this post


Link to post
Share on other sites

The copy of modules.php in this package doesn't have addslashes() in it anywhere. You must be using some modified code. That will not necessarily work with this USPS module. Did you modify that file with the changes from this package?

 

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

Minor bug swat:

 

On line 101 of the MVS version of usps.php, the space between the ' and MODULE_SHIPPING_USPS_INTL_SERVICES_ constant needs to be removed or it generates a warning that the constant MODULE_SHIPPING_USPS_INTL_SERVICES_1 can't be found.

 

Also need help with this warning: Warning: Illegal string offset 'ServiceName' in C:\xampp\htdocs\catalog\includes\modules\vendors_shipping\usps.php on line 149

 

this is line 149:

	 if (isset ($iExtras[$val['ServiceName']]) && tep_not_null($iExtras[$val['ServiceName']]) && ((constant('MODULE_SHIPPING_USPS_RATE_TYPE_' . $vendors_id) == 'Online' && $val['AvailableOnline'] == 'True') || (constant('MODULE_SHIPPING_USPS_RATE_TYPE_' . $vendors_id) == 'Retail' && $val['Available'] == 'True'))) {

 

This only happens on international quotes, whether or not there are any service extras enabled, which is interesting as line 141 is virtually the same code as above ($dExtras instead of $iExtras) but doesn't generate the same warning.

Thanks for the bug report. I've fixed that in the master copy.

 

The second one is PHP being excessively picky. It should not return an error for that test. You could try something like this:

 

if (array_key_exists ('ServiceName', $iExtras[$val]) && tep_not_null($iExtras[$val['ServiceName']]) && ((constant('MODULE_SHIPPING_USPS_RATE_TYPE_' . $vendors_id) == 'Online' && $val['AvailableOnline'] == 'True') || (constant('MODULE_SHIPPING_USPS_RATE_TYPE_' . $vendors_id) == 'Retail' && $val['Available'] == 'True'))) {

 

Regards

Jim

That throws a 'Warning: array_key_exists() expects parameter 2 to be array, null given' warning. Odd, since parameter 2 is an array, although an empty one.

This is getting ridiculous. I'm tempted to just throw an (array) in front of the second parameter. Unless I can come up with a better test....

 

OK, try adding !tep_not_null($iExtras[$val]) && in front of that first test.

 

Regards

Jim

That got it. Thanks! :)

 

Line 149 is acting up again for some reason. Nothing's changed since my last post, but for some reason I'm now getting a warning about an illegal offset type in line 149 for international quotes. Here's the modified line 149, which was working fine:

 

if (tep_not_null($iExtras[$val]) && (array_key_exists ('ServiceName', $iExtras[$val]) && tep_not_null($iExtras[$val['ServiceName']]) && ((constant('MODULE_SHIPPING_USPS_RATE_TYPE_' . $vendors_id) == 'Online' && $val['AvailableOnline'] == 'True') || (constant('MODULE_SHIPPING_USPS_RATE_TYPE_' . $vendors_id) == 'Retail' && $val['Available'] == 'True')))) {

 

Thanks in advance.

Share this post


Link to post
Share on other sites

What's the error message? I don't see anything wrong there.

 

The fact that it suddenly stopped working is worrying. Did your host update the PHP version?

 

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

The error message is:

 

Warning: Illegal offset type in C:\xampp\htdocs\mantisosc\includes\modules\vendors_shipping\usps.php on line 149

 

It's a localhost installation: osCommerce 2.3.3, xampp 1.8.1, PHP 5.4.7, which hasn't changed since I first installed it.

 

The only thing that got changed about the o/s since Jan 2 was the Microsoft NET framework 4.5.1 for Windows Vista x64-based Systems (KB2858725) on 1/13. I'm not sure if that was when the cart broke again or later when USPS changed the API since I couldn't get back to work on it until last week.

Share this post


Link to post
Share on other sites

As of Friday afternoon, (not exactly certain what time) my USPS domestic first class mail stopped returning rates. The International first class is fine. Has anyone heard of an issue with this over the weekend?

 

I also have a second issue that I have had for years, but no one else seems to complain about. It seems to be random, in that we may go weeks without the problem and then have it happen a couple of times a day for a week then go away again.

 

Basically a customer chooses the shipping method at checkout. We believe we have narrowed the method down to USPS Priority. They enter the credit card information and continue. When they get to the confirmation screen the shipping method shows "u:" with no costs. The customer can finish the checkout, but the system does not charge for shipping. In the back end of the cart the shipping shows as "u:"

 

We have checked to see if any products were shared between the orders that have this issue, but they do not. Also, this has happened using various USPS mods over the years. I am just wondering if anyone else has ever experienced this? Thanks!

Share this post


Link to post
Share on other sites

@@surknight Sorry, I missed this post. I don't see what's wrong with that line. Possibly a new version of PHP is responsible. I don't know if the .NET update would also update PHP, but I wouldn't be surprised. Or it just could be a bug in PHP.


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

Share this post


Link to post
Share on other sites

@@beemertec I haven't seen any problem with First Class. I just checked a live site and it's still getting quotes, so I don't have any idea why you're not.

 

Your other problem sounds like something with USPS. The module gets a set of quotes to give the options to the customer, then after they chose one it gets another quote for just that one option. It sounds like something is going wrong with that second quote.

 

Check that you are using the latest version of this module, then find this code in the module (line 385)

 

    // mail( STORE_OWNER_EMAIL_ADDRESS, STORE_OWNER, $mail_body );

and uncomment that line. You will then get an email any time the module is used. When the error occurs, look in the Response section of that message for errors.

 

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

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

×