Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

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


Guest

Recommended Posts

@@dculley On July 28, the USPS made changes to their APIs that have resulted in the problem you are experiencing. I've just been fixing it in my stores. Our friend @@kymation has taken over this module, look back through the pages, he has provided a link to a new module and instructions here in this thread. The link can be found on page 29, post #575: http://www.oscommerce.com/forums/topic/383307-usps-rate-v4-intl-rate-v2-official-support-thread/page__st__560

 

As for what to do with it, see his responses to my question: "It's the module file -- catalog/includes/modules/shipping/usps.php. Be warned that it doesn't work completely. First class is still a mess."

 

I hope that helps!

 

Chewers,

 

DesertCoder

Link to comment
Share on other sites

OMG - Thanks guys, It is late where I'm out and I will tackle this tomorrow. I need a clear head for this one.

DesertCoder - Thanks I will look and see what it does.

Jim - is in update to this package forth coming soon?

Link to comment
Share on other sites

@@kymation Well...

 

Here's what I get now:

 

Warning: include_once(includes/classes/http_client.php) [function.include-once]: failed to open stream: No such file or directory in /home/content/path/path/html/sitename/ext/modules/payment/paypal/express.php on line 4

 

Warning: include_once() [function.include]: Failed opening 'includes/classes/http_client.php' for inclusion (include_path='.:/usr/local/php5/lib/php') in /home/content/path/path/html/sitename/ext/modules/payment/paypal/express.php on line 4

 

Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at /home/content/77/7516777/html/LDcomics/ext/modules/payment/paypal/express.php:4) in /home/content/path/path/html/sitename/includes/functions/sessions.php on line 102

 

Fatal error: Class 'httpClient' not found in /home/content/path/path/html/sitename/includes/modules/shipping/usps.php on line 359

 

I added the code you suggested right at the top just under the opening php tag.

 

The files DO exist where the error says they do not.

 

Head scratching time...

 

Cheers and thanks,

 

DesertCoder

Link to comment
Share on other sites

@@dculley

This one is pretty much abandoned. I'm tired of fixing modules twice a year. I'm building one that won't break so easily when USPS decides the change the names of their services. You can read the module development thread if you're interested.

 

@@DesertCoder

That won't work if the file is being called on the Admin side. You'll have to give it the correct path from there. Try ../includes/classes/http_client.php

 

Regards

Jim

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

Link to comment
Share on other sites

Then the original version should have worked. Maybe it thinks the calling file is in the paypal directory. In that case the code would be

 

include_once(../../../../includes/classes/http_client.php)

 

This is getting messy.

 

Regards

Jim

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

Link to comment
Share on other sites

So much for the shotgun approach. I'm afraid you're going to have to chase it down. Or try the USPS Methods module. Or use the table approach.

 

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 glad that worked. Sometimes the old shotgun saves some time. It's a good thing, too, as the Paypal code is a pain to dig through.

 

Regards

Jim

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

Link to comment
Share on other sites

It appears that USPS has finally fixed the First Class rate response. Previously all of the First Class services were returning the same service name, which made it difficult to get this code to select the right service. The services now seem to be returning the correct values, so I've updated the code. You can find the file here. Again, this replaces the catalog/includes/modules/shipping/usps.php file, and you must have the V4 addon files as well.

 

The USPS server is being somewhat unreliable right now, so this is not extensively tested.

 

Regards

Jim

Edited by kymation

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

Link to comment
Share on other sites

I just got in to the office. Downloaded and installed the above. All is working but first class is not showing up as an option on the checkout side.

Take it this is something still being worked on?

Link to comment
Share on other sites

Did you uninstall and reinstall the module in your Admin? Do you have one of the First Class options selected in your Admin?

 

Regards

Jim

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

Link to comment
Share on other sites

I did - I uninstalled, renamed the old file (because I'm a chicken) and uploaded the new one. I reinstalled and have checked by both first class. I know thes is the new file because the options have changed.

Link to comment
Share on other sites

I don't know if this helps. In Admin, edit an item in the catalog and click on Restrict USPS shipping method, it shows up there. So the admin side seems to be wroking.

Just on checkout it is not showing up. The 2 items I tested one weighs 3oz and the other 6oz on 2 differnt orders.

Link to comment
Share on other sites

Apparently the First Class rates fix is not universal. I'm going back to working on the new code. That's a better use of my time long-term. This old code is just too much of a mess.

 

Regards

Jim

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

Link to comment
Share on other sites

Hello

I have this add on installed - I tried the updated file in the above posted but get the error that refers to line 359 (when checking out with PayPal). Is there a working patch for this ? or any other information for fixing this issue?

 

Thank You!

Link to comment
Share on other sites

@@kymation - Thanks for the new file!!! This is alot cleaner looking than the Frankenstein files I was working with earlier.

Does anyone have a fix for domestic first class yet?

It appears that USPS has finally fixed the First Class rate response. Previously all of the First Class services were returning the same service name, which made it difficult to get this code to select the right service. The services now seem to be returning the correct values, so I've updated the code. You can find the file here. Again, this replaces the catalog/includes/modules/shipping/usps.php file, and you must have the V4 addon files as well.

 

The USPS server is being somewhat unreliable right now, so this is not extensively tested.

 

Regards

Jim

I just got in to the office. Downloaded and installed the above. All is working but first class is not showing up as an option on the checkout side.

Take it this is something still being worked on?

 

It appears that MailService still returns First-Class Mail for all Letter, Large Envelope, and Parcel. I've developed a workaround for Letter and Parcel (the two I use) and included First-Class International Letter.

 

Basically, there's one line where I hard-coded the weight-limits I wanted for First-Class.to 0.1875 pounds (or 3 ounces). First-Class Letter rates will show if shipping weight is less than 3 ounces, but First-Class Parcel rates will show if shipping weight is 3 ounces or greater. I suppose one can mod it further to include Large Envelope. The 0.1875 number can be changed to anything up to 3.5 ounces (or 0.21875).

 

It doesn't grant us the option of offering both Letter, Large Envelope, and Parcel simultaneously. But at least First-Class works now, to some degree. All in all, I'm happy with this version for now. Thanks to @@kymation for all the work done to making it functional with the latest USPS changes.

 

See attached file and use at your own risk.

 

usps_fcmod.php

Edited by a.forever
Link to comment
Share on other sites

@a.forever

That's odd. I'm getting the correct responses. For example:

First-Class<sup>™</sup> Package Service

 

I would very much like to know what the difference is. Are there multiple USPS servers that don't have all the updates? Is there just one server but different results depending on origin/destination?

 

Would you be willing to do some testing?

 

Regards

Jim

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

Link to comment
Share on other sites

My Canada customers are ordering under First Class Intl. Just got orders coming back in from them. YA. So it must be showing up for them. Just not domistic USA. I'm not a code writer. I be willing to help anyway I can to help find a fix for this. Just let me know.

Link to comment
Share on other sites

@@dculley

I uploaded my test file to the development addon page. Please download that and read the instructions in the top of the file. Add your USPS id, save, and upload to your store.

 

Open the file in your browser. It will show arrays of the services available from USPS. You want to look for the Domestic and International First Class service names.

1. Are those services showing just "First Class Mail" or do they show more information?

2. Just under the line where you added your USPS ID there are defines for the source and destination ZIP codes. Change the source to your ZIP and try again. Does the output change?

 

Please post here with your results. This will help understand the problem. With more information we can fix existing modules and build a better replacement module.

 

Regards

Jim

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

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