Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

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


Guest

Recommended Posts

Jim.. just doing a compare of Jetta's last version (http://addons.oscommerce.com/info/8327 - USPS Rate V4 Intl Rate V2 - v.1.7 - FIX) and your latest (8.13.2013 12.28pm).. I see you did a WHOLE lotta reformatting to pretty things up.. I will assume so you can follow the code better.. but what I also see from Jetta's version to yours is around 263 (your file) where the first class rate request is.. there are tons of differences besides just the service name wordings... then way down (your's 376-400, 462-476, 491-631) is a WHOLE bunch of new(?) stuff I haven't really looked at yet..

 

This whole mess with people using (and not know which) of 3 modules is a disaster!!! I prefer to have 1st class working, but the handling fees need to be working.. so for me this version is the middle road of no being perfect yet :) My client on his osC2.5 is crazy that there are no handling fees (http://addons.oscommerce.com/info/487), but I am not reformatting his whole store to any other module until I know one is 100%

 

 

Debbie D
Franklin County, VA "Moonshine Capitol of the World"
osCmax Mobile Template oscmaxtemplates.com

Link to comment
Share on other sites

A lot of Jetta's code was very difficult for me to read. I have poor vision, and that dense block of procedural code was just painful. I converted it where I needed to make sense of it. The new lines are mostly just existing code that I broke out to make it readable.

 

I probably need to go back to the source and trap what this module is sending to USPS and compare that to what I know works. I'll see if I can ind some time today to do this.

 

Regards

Jim

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

Link to comment
Share on other sites

thanks.. I was havin trouble with another MOD and someone suggested I do a "print_r" to see the REAL output.. I;m sure you know about that tho...

 

Happy to test what you get.. ya I saw most of the changes up top especially were for ease of reading..

Debbie D
Franklin County, VA "Moonshine Capitol of the World"
osCmax Mobile Template oscmaxtemplates.com

Link to comment
Share on other sites

First, kymation, thank you for your leadership role in this thread. Thanks to everyone else here, as well.

 

A summary of the actual changes required to upgrade this contribution would be greatly appreciated.

 

Maybe summarizing my status will help clarify for some others...

 

Here's where I think I am:

 

OSC 2.2 RC 2.

 

I have this USPS Module installed:

USPS Rates ServerV4 (for osc2.2) / http://addons.oscommerce.com/info/8403

 

Now, it appears that there's an update I hadn't applied:

USPS Methods Rates V4 Intl Rates V2 - 01-27-13 Update / http://addons.oscommerce.com/info/8702

 

So, I applied this update.

 

At this point, I should now be ready to make the updates contained in this thread to fix the July 28th USPS changes.

IS THAT CORRECT?

 

So, now, here's my problem:

 

I've been reading through this thread and there changes on top of changes to update for USPS and then a few more changes to correct side issues, but I'm having a terrible time trying to figure out exactly which changes I should apply.

 

WOULD YOU OR SOMEONE ELSE HERE BE SO KIND AS TO SUMMARIZE THE STATUS AND PROVIDE THE LATEST SET OF FILES AND HACKS REQUIRED TO GET THIS CONTRIBUTION GOING?

 

I am a programmer and am happy to help with furthering this effort to a clean update, but I need to see the actual status, install the changes, and do some testing before I can provide any useful assistance.

 

OK, I SEE THE FILE KYMATION POSTED AT #748. Is this the best version of usps.php, if I don't care about restricting by products?

 

AM I CORRECT THAT NO VERSION WORKS FOR FIRST CLASS MAIL?

 

ARE THERE ANY OTHER FILES IN ADDITION TO usps.php which I need to update?

Edited by hostricity
Link to comment
Share on other sites

The January update is actually unnecessary as those changes are included in the July update. You only need to uninstall, replace your module file with the one I linked to, then reinstall.

 

The latest version I posted works except for First Class. I'm now doing an experiment to see if I can identify what's wrong with the First Class request, as everything in the module looks correct to me.

 

Regards

Jim

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

Link to comment
Share on other sites

Ha!

 

<Error><Number>-2147219428</Number><Source>DomesticRatesV4;clsRateV4.ValidateFirstClassMailType;RateEngineV4.ProcessRequest</Source><Description>Invalid First Class Mail Type.</Description>

 

Now I just have to find out what it thinks a valid type should be. More fun.

 

Regards

Jim

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

Link to comment
Share on other sites

I posted too soon. A second try using the same code returns quotes for First Class and no error message. Whoops.

 

Worse, it's returning the incorrect names for the First Class services that it was returning the first week. I guess I was wrong in assuming they'd fixed that. It now looks like they have multiple servers that are not all running the same software, or they have one server that responds to identical requests in wildly different ways.

 

Whatever the cause, this would take a lot of extra code to fix. I don't have the time to put into that kind of effort, especially since I'm working on a new module that won't be as fragile as this one. My time is better spent working on that one.

 

Regards

Jim

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

Link to comment
Share on other sites

@@hostricity

you should be OK (except for the first class issues) by applying any one of Jim's updates.. its all the same file in several posts/minor changes .. further.. Jim is right I never applied the Jan change myself, my module continued to work somehow :)

 

My concern is I am not 100% sure why Jetta (fullUVscents) veered off and posted that version like that.. doing a compare to my version prior and the one you are using it looks very close so I do think you will ok to just move right up to the @ 8702

Debbie D
Franklin County, VA "Moonshine Capitol of the World"
osCmax Mobile Template oscmaxtemplates.com

Link to comment
Share on other sites

*** WARNING *** This WILL be cross posted for clarification across ALL USPS shipping module threads.

 

There are, for all intent and purpose, TWO different modules, 2 very different modules. One of those modules has morphed itself 3 times in the ADD-ON section of osCommerce.com/info/xxxx

 

When posting to any USPS module thread PLEASE state which osC vX.X.X as well as which USPS module you are using. If you are unsure what version of the USPS module you are currently using, PLEASE paste the first few lines of /catalog/includes/modules/shipping/usps.php file here so maybe we can help you make the determination.

 

Here is my take on the module morphing:

http://addons.oscommerce.com/info/8327

USPS Rate V4 Intl Rate V2 - v.1.0

at some point was set to NOT allow uploads to the module, essentially closing it to further updates.

this morphed into:

http://addons.oscommerce.com/info/8403

USPS Rates ServerV4 (for osc2.2)

which also at some point was set to NOT allow uploads to the module, essentially closing it to further updates.

this then morphed into:

http://addons.oscommerce.com/info/8702

USPS Methods Rates V4 Intl Rates V2 - 01-27-13 Update

this one is being currently maintained, within thread http://www.oscommerce.com/forums/topic/383307-usps-rate-v4-intl-rate-v2-official-support-thread albeit with some errors still in regards to First Class rates and handling fees. See post #748 above for that: http://www.oscommerce.com/forums/topic/383307-usps-rate-v4-intl-rate-v2-official-support-thread/page__st__740#entry1678247

 

The second module is:

http://addons.oscommerce.com/info/487

USPS Methods

This one is being maintained within the ADD-ON section and within thread

http://www.oscommerce.com/forums/topic/146950-contribution-usps-methods/ HOWEVER there are MANY MANY updates there.. 5.2.x 6.x and now 5.3

 

There is at least one further active USPS module thread:

http://www.oscommerce.com/forums/topic/393466-heads-up-july-28-2013-usps-name-change-for-express-mail/

Heads Up: July 28, 2013 USPS Name Change for Express Mail

which is mostly referring to the USPS Methods module #487 with some cross posting going on there as well.

 

So there you have it.. please lets try and post to the proper thread and let everyone know what you are using so we can best help you!

Edited by wkdwich

Debbie D
Franklin County, VA "Moonshine Capitol of the World"
osCmax Mobile Template oscmaxtemplates.com

Link to comment
Share on other sites

whew... now that that is all said and done, I'm wondering how many of you using THIS module have gone backwards/sidewards whatever! to USPS Methods with all the DEETH statements http://addons.oscommerce.com/info/487

 

I have a client running osC v2.5 with USPS Methods v5.2x that I am going to take a stab at upgrading him this AM to the latest posting of USPS Methods v5.3 AedeaInnovations says he is getting first class, handling fees and everything.. If it does everything it says it supposed to do then I just may try and switch myself over..

Debbie D
Franklin County, VA "Moonshine Capitol of the World"
osCmax Mobile Template oscmaxtemplates.com

Link to comment
Share on other sites

Hi, Jim; Sorry for the delay. I deleted the db called "restored" and discovered that was actually the active db for our store. Had to get server to restore it, and then follow your instructions. I did so, and no usps came up under configuration_key. Then I very carefully went through the install process (for the seventh time) and voila, it came up in checkout. I don't know what diod it. Maybe it was the db afterall. Whatever, it works.I was hoping you might have a suggestion why upsxml keeps putting a fifty lb. bag into two boxes and charges extra. I see nothing in admin that would cause this, and the product page lists the weight plus packaging correctly. Any ideas? Thanks again for your help.Lark

Link to comment
Share on other sites

Check your maximum shipping weight (in your Admin under Configuration >> Shipping/Packaging). I can't think of anything else that would cause that.

 

Regards

Jim

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

Link to comment
Share on other sites

Bingo! I had to change the extra charge for large packages to get it down to the proper weight, but it worked. Thank you.One small item on the usps issue. Although Priority Mail shows up and the calculations are correct, I see some code before and after the TM like so: Priority Mail 1-Day<sup>™</sup>. This is on the checkout page under shipping. Not a major problem, but I thought you might know what to do about it. I looked at catalog/includes/language/English/modules/shipping/usps.php and catalog/includes/modules/shipping/usps.php but did not see this code. Any ideas? Not a big deal, I am very glad everything works now. Thanks again.Lark

Link to comment
Share on other sites

Thank you, @@kymation and @@wkdwich.

 

Since we don't use first class postage, everything is now great and working.

 

Jim, I think you are correct that the USPS has multiple servers that have not all been updated the same way.

 

NOW: My client is going to be on OSC 2.2 RC2 for at least another year.

 

So, I want to do something to prevent this from happening again.

 

I think the problem with this module breaking is that it is using the service name text strings (which change) instead of a permanent key. I think this because our Prestshop stores don't crash when the USPS makes there changes. (I haven't looked at the API).

 

BEFORE I DIG INTO THIS FURTHER, I AM SOLICITING INFO FROM THOSE WHO MAY HAVE GONE HERE BEFORE!!

 

1. Am I correct that this module is breaking because it is using a text field instead of the proper database row key field?

 

2. Is this the module to focus on, or is there another USPS module which doesn't have these problems, or would be a better starting point for a fix?

 

I will say that when I set this module up in early 2012, I replaced whatever we had before and switched to this one because I couldn't get the updated version of what we had to work (or maybe there wasn't one available yet).

 

My impression is that this module is relatively simple, provides the features we need and would be easier to upgrade than to switch to another module --- but that is just a guess.

Link to comment
Share on other sites

Bingo! I had to change the extra charge for large packages to get it down to the proper weight, but it worked. Thank you.One small item on the usps issue. Although Priority Mail shows up and the calculations are correct, I see some code before and after the TM like so: Priority Mail 1-Day<sup>™</sup>. This is on the checkout page under shipping. Not a major problem, but I thought you might know what to do about it. I looked at catalog/includes/language/English/modules/shipping/usps.php and catalog/includes/modules/shipping/usps.php but did not see this code. Any ideas? Not a big deal, I am very glad everything works now. Thanks again.Lark

 

I had a similar problem last year and had to add some code to filter out the html garbage. Sorry, I don't have it to give it to you, but I think there are some posts here with samples of that filtering code.

Link to comment
Share on other sites

@@hostricity

If I read you right, you are talking about crating or modifying one of the USPS modules to work with the service CODE #'s as opposed to the NAMES.. someone already started fooling with such a thing..

see:

http://addons.oscommerce.com/info/8869

USPS Codes

v2.3; Shipping Modules

Debbie D
Franklin County, VA "Moonshine Capitol of the World"
osCmax Mobile Template oscmaxtemplates.com

Link to comment
Share on other sites

*** WARNING *** This WILL be cross posted for clarification across ALL USPS shipping module threads.

...

 

 

Since you've done a comprehensive review of the various USPS modules, would you please render your opinion on my post #766 above? I'd really like to get this cleaned up before the USPS makes another change in the hope that further USPS changes won't break the module.

Link to comment
Share on other sites

heheh I did:

Posted Today, 06:10 PM

 

@@hostricity

If I read you right, you are talking about crating or modifying one of the USPS modules to work with the service CODE #'s as opposed to the NAMES.. someone already started fooling with such a thing..

see:

http://addons.oscommerce.com/info/8869

USPS Codes

v2.3; Shipping Modules

Debbie D
Franklin County, VA "Moonshine Capitol of the World"
osCmax Mobile Template oscmaxtemplates.com

Link to comment
Share on other sites

@@hostricity

Yes, in fact all of the current modules key on the service name rather than the ID number. Using the ID number will fix many of these problems. Not all of them, since all First Class services have an ID of 0, so we have to depend on some other field to separate those. The USPS API is a mess, and their servers do not deliver a consistent result, nor do all of the results returned match the API documentation. This means designing a module that can hit a moving target.

 

All of the current modules are built on old-fashioned procedural code that is difficult to read and difficult to reuse. I have started over with a new design that will be adaptive and modular. You can follow the process on the development thread. @@wkdwich already linked to the development code, which is currently just a test file that tells me what the USPS server is currently returning, so I have a basepoint to start from. That code is being reused in the installer section of the new module.

 

I cannot guarantee support for old versions of osCommerce. The design target is osC 2.3.3 and PHP 5.2+. Older versions should work, but may take some tweaking. We'll see when we get there.

 

Feel free to participate in the discussion. I'm probably not going to include features unless somebody asks for them, which many already have. I don't guarantee that I will include every feature that somebody wants, but I will if enough people ask.

 

Regards

Jim

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

Link to comment
Share on other sites

I am posting this here because I saw more discussion about it here than anywhere else. :)

 

I want to set up the USPS Shipping Labels Add-on and don't know where to start.

 

There seems to be no documentation on which version to use, whether or not it still works, and how to install it.

 

Sounds like your looking for USPS auto fill....to generate labels from the order details page?

 

http://addons.oscommerce.com/info/1498

 

That saves me hours a day!

 

I was hoping some of you could lend some insight because I am not as pro as everyone on here.

 

thanks,

 

Brett

 

Edit:

Used this entire thread to get the USPS Shipping module to work correctly, and I've tested it quite a bit with perfect results.

Using osCommerce Online Merchant v2.3.1

Edited by KVA Brett
Link to comment
Share on other sites

@@dculley

Patience is a virtue. Or so they tell me. Hang in there, progress is occurring.

 

Although I'm about to go hire an exorcist. I swear this thing is possessed. Swat one error and two more pop up where none were seen before.

 

I'm going to fix this old module (mostly because someone is paying me to) and then I'm going back to the new version, which is presenting it's own unique challenges. And I thought this would be fun.

 

Regards

Jim

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

Link to comment
Share on other sites

Well, that was ... interesting. I have a version that seems to return USPS First Class quotes. I haven't tested this thoroughly, so treat it with caution. I recommend putting it on your test store first and check it out before committing to a live server.

 

The code is available here. That archive contains both the stock version and the modified MVS version. Please mention which one you used when you report success or failure. Bug reports are welcome as always.

 

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