Jump to content
bad_lemming

[Contribution] - USPS Methods

Recommended Posts

Further evidence that this contribution is not, in fact, supported - I asked perfectly reasonable questions more than 2 months ago (11/20/2006), and there haven't been any useful responses in that time. Phooey. If you're reading this and you haven't installed this contribution yet, hey - DON'T. When it doesn't work correctly, nobody will help you.

I've been using v2.6 now since 2003 at lighterdeals(dot)com. Has and is still working for me. Also have a v2.8 from 11 Aug 2005 working in another shop, and still is since that date.

 

When nobody can help you, you must help yourself. there is no guarantee anyone will help with any contribution. contributors did the hard work and donated the code for all, support is optional. I help when I can with my contributions, but there is no guarantee. Unfortunately there seems to be a trend as of late where folks will ignore the forums and simply post-and-forget code to the contributions. And equally unfortunate are those that complain when instant help or short-order coders aren't doing their work for them. the forums are a decent crutch, but not a substitute for learning and understanding the php you decided to support.

Share this post


Link to post
Share on other sites

hey everyone, i have installed usps method 2.8d instructions update

from

http://www.oscommerce.com/community/contri...y,2/search,usps

 

i get this error

An error occured with the USPS shipping calculations.

If you prefer to use USPS as your shipping method, please contact the store owner.

 

 

i have checked under my configuration/shipping and packaging, all is well there, i have the country and zip code

i checked the settings in teh admin and all looks good there also, usps has transfered the account to the production server and that is what i have selected in the admin..

 

thoughts?

 

:-"

 

part of the email from them said..

 

> 1. The Production Server URL is:

> http://production.shippingapis.com.

 

For APIs calling the secure server, the URL is

https://secure.shippingapis.com.

 

2. There is a line of code that refers to "shippingapitest.dll". You'll need to remove the word "test".

 

should i be changing a url somewhere, or is it changed already by default in the code?

Edited by tec

Share this post


Link to post
Share on other sites
Yes, it will. I am not certain of the exact effect, but I use this contribution in my store and will look into fixing it, as soon as USPS posts the revisions to the Rate V2 and International rate calculators. I'll also contact the USPS ICCC to determine if the documentation is already available somewhere. It hasn't made it to the webtools page yet.

 

--Glen

 

Glen,

This will not be an easy task as the new rates are not only weight based but vary based on the size of the package. Any priority package over 1 foot cube is going to have a size surcharge. There will have to be an oversize entry for this contribution that takes package size into account. I really think it will be a disaster to deal with and I am thinking of just not using USPS.

 

Steve

Share this post


Link to post
Share on other sites
Glen,

This will not be an easy task as the new rates are not only weight based but vary based on the size of the package. Any priority package over 1 foot cube is going to have a size surcharge. There will have to be an oversize entry for this contribution that takes package size into account. I really think it will be a disaster to deal with and I am thinking of just not using USPS.

 

Steve

 

The old USPS API will still be available from USPS after May 14th, 2007. (Correct me if I'm wrong)

 

The domestic method probably will continue work after May 14th, 2007. All of my package are well within 1 cubic feet, so i'm not too worried about the dimensional surcharge.

 

The real problem for me is the international method. The EMS and GPX probably will work fine just like before. The real headache is Air Letter Post, Air Parcel Post and Global Prority Mail. They are all gone/will be changed after May 14th, 2007.

 

I'm using verion 2.6 since 2003 and will make an attempt to make changes myself.

 

Will post the code once tested properly. (after May 14th)

 

Fingers Crossed.

Share this post


Link to post
Share on other sites

I am lost......all my settings are correct, USPS sais the account is active on the production server....yet i still cant get the rates to show, i keep getting the same error. I have uninstalled and reinstalled via the admin and still notta

 

The read me file to the mod says USPSMethods_2.8d

 

i dont get it :(

Share this post


Link to post
Share on other sites

has anyone got this thing to work latetly? are these https changes that usps are talking about part of the problem? i see that someone sais that its not part of the problem, is this right?

Share this post


Link to post
Share on other sites
The old USPS API will still be available from USPS after May 14th, 2007. (Correct me if I'm wrong)

 

The domestic method probably will continue work after May 14th, 2007. All of my package are well within 1 cubic feet, so i'm not too worried about the dimensional surcharge.

 

The real problem for me is the international method. The EMS and GPX probably will work fine just like before. The real headache is Air Letter Post, Air Parcel Post and Global Prority Mail. They are all gone/will be changed after May 14th, 2007.

 

I'm using verion 2.6 since 2003 and will make an attempt to make changes myself.

 

Will post the code once tested properly. (after May 14th)

 

Fingers Crossed.

 

I had the impression the changeover was taking place even sooner - or is there going to be a transition period during which the old international methods co-exist with the new ones?

 

I'm not looking forward to the headache, but I'm also hoping that hacking the files won't be too difficult. Thanks in advance for whatever work you do, and I'll be checking this space!

Share this post


Link to post
Share on other sites

ok, so, could this whole USPS swtich thing be teh reason i cannot get shipping prices on the site? is there something that can be done, or just sit tight until after the 14th? i keep getting an error that there were problem calculating the shipping cost

Share this post


Link to post
Share on other sites

ok, can someone clarify something for me? i read in a thread that the userid (email addy) should also go into the password section? is this correct?

 

i have tried it but still get the same error about usps not being able to calculate shipping cost

Share this post


Link to post
Share on other sites

ok, i got it, i had the wrong userid in the user id box

Share this post


Link to post
Share on other sites

I have just posted the update for USPSMethods_2.8d on the contribution for the module: http://www.oscommerce.com/community/contributions,487.

Read the instructions and if anything is unclear or does not work I will try and help out if I can. I read through the recent posts and in going back and forth with the USPS ICC reps the past week I can answer some of the questions:

 

1) The existing international API's are going to be no longer available as of May 14, 2007 so I take that to mean that if you do not update and you utilize the USPS module as it is now it will not work.

2) In my testing the domestic rates and services all still work with no updates needed.

3) From my communications with USPS ICCC there will be no transition period which is why they have the testing environment available, although lacking with any supporting documentation.

 

I hope this all helps!

Share this post


Link to post
Share on other sites
Glen,

This will not be an easy task as the new rates are not only weight based but vary based on the size of the package. Any priority package over 1 foot cube is going to have a size surcharge. There will have to be an oversize entry for this contribution that takes package size into account. I really think it will be a disaster to deal with and I am thinking of just not using USPS.

 

Steve

 

Steve,

Effective May 14, packages over one cubic foot in volume will be charged either the actual weight or the dimensional weight, whichever is greater. This is designed to discourage shipping "balloon" packages. It won't affect many shippers. As a rule of thumb, if your rectangular packages weigh less than 9 lb/cubic foot, and you ship to zones 5-8, you will be subject to the surcharge. Depending on the density, you might incur a surcharge of a few dollars. Shippers of odd-shaped packages have a different calculation (DMM 123.1.4.2)

 

I don't foresee a problem in my shop, as the largest package I ship is a 12x12x12" box, and my packages of this size are typically about 15 pounds. If I wind up with a package subject to dimensional weight, I'll just eat the extra postage.

 

People shipping low value, low density (pillows, bubble wrap, packing peanuts, etc) packages will have problems, but most will be fine.

 

--Glen

Share this post


Link to post
Share on other sites
I have just posted the update for USPSMethods_2.8d on the contribution for the module: http://www.oscommerce.com/community/contributions,487.

Read the instructions and if anything is unclear or does not work I will try and help out if I can. I read through the recent posts and in going back and forth with the USPS ICC reps the past week I can answer some of the questions:

 

1) The existing international API's are going to be no longer available as of May 14, 2007 so I take that to mean that if you do not update and you utilize the USPS module as it is now it will not work.

2) In my testing the domestic rates and services all still work with no updates needed.

3) From my communications with USPS ICCC there will be no transition period which is why they have the testing environment available, although lacking with any supporting documentation.

 

I hope this all helps!

 

Thanks for doing that. The only problem with using the existing domestic rate calculator is that it doesn't let you submit package dimensions for the dimensional weight calculation, so some large, low density packages will calculate lower postage than actually required. There is no support in osC to determine package size, so it's kind of moot, anyway.

 

In your instruction, you weren't sure about whether some of the international rates would continue. USPS has released several documents related to the realignment of international service offerings; the best one I have found is the current issue of MailPro, their newsletter for mailing professionals, found at <http://www.usps.com/mailpro/2007/marapril/marapril.pdf>. The current overlapping product lines have been streamlined into four classes; First Class International, Priority Mail International, Express Mail International (EMS), and Global Express Guaranteed. Economy (surface) letter and parcel post are no longer available at retail (though still available as a contracted, custom mail service).

 

The test environment that they are using is actually a staging area for the new live release code, unlike their previous test environment, which only accepted certain addresses. In some ways, this is an improvement, but don't expect it to be available forever.

 

Note that the USPS Board of Governors has made two changes subsequent to the publication of the rates; the Priority Mail flat rate boxes will now be $8.95 instead of $9.15, and the non-machinable surcharge for First Class letters now applies regardless of weight.

 

--Glen

Share this post


Link to post
Share on other sites
Thanks for doing that. The only problem with using the existing domestic rate calculator is that it doesn't let you submit package dimensions for the dimensional weight calculation, so some large, low density packages will calculate lower postage than actually required. There is no support in osC to determine package size, so it's kind of moot, anyway.

 

 

--Glen

I am having a problem with the 2.8d contrib update. When I try to modify the database tabe configuration to change the set_function column to VARCHAR(555), I get an error that the max characters is 255. I am on MySQL version 4.0.27. What do I do now? The helpful message accompanying the error says I should use type BLOB (binary large object). Please help if you can.

 

Also, I use the insurance add-on to this attrib, and I have read on the USPS website that the structure of domestic insurance is changing. Specifically the current add-on breaks insurance down into tiers:

$0 - $50

$50 - $100

US/Canada per $100 (additional above $100)

 

The new changes will create two new tiers:

$0 - $50

$50 - $100

$100 - $200

$200 - $300

US/Canada per $100 (additional above $300)

 

-Ron

Share this post


Link to post
Share on other sites
I am having a problem with the 2.8d contrib update. When I try to modify the database tabe configuration to change the set_function column to VARCHAR(555), I get an error that the max characters is 255. I am on MySQL version 4.0.27. What do I do now? The helpful message accompanying the error says I should use type BLOB (binary large object). Please help if you can.

 

What are you trying to accomplish? The set_function field in the configuration table is just informational.

 

Also, I use the insurance add-on to this attrib, and I have read on the USPS website that the structure of domestic insurance is changing. Specifically the current add-on breaks insurance down into tiers:

$0 - $50

$50 - $100

US/Canada per $100 (additional above $100)

 

The new changes will create two new tiers:

$0 - $50

$50 - $100

$100 - $200

$200 - $300

US/Canada per $100 (additional above $300)

 

-Ron

 

Either look at the existing code and modify it to suit your needs, or wait for someone else to fix it. I don't use the insurance add-on, and don't have time at the moment to look at it. Perhaps someone else who knows PHP and has time will have this done by Monday.

 

--Glen

Share this post


Link to post
Share on other sites
What are you trying to accomplish? The set_function field in the configuration table is just informational.

 

Either look at the existing code and modify it to suit your needs, or wait for someone else to fix it. I don't use the insurance add-on, and don't have time at the moment to look at it. Perhaps someone else who knows PHP and has time will have this done by Monday.

 

--Glen

Thank you, Glen. I didn't know what the set_function field was used for.

 

Can anyone tell me why the uspsMethods 2.8d contrib doesn't allow the removal of all services by deselecting all of the associated boxes? I don't know if this is a common problem with 2.8d or just a problem with my install.

 

I can select one or more services by checking boxes in admin, but once selected, I can deselect any combination of services but I can't deselect all of them. As an example, if I select Priority and Express Mail, I can then deselect either one, but not both. I have to manually edit my database to remove the last service.

 

Anyone else see this?

 

-Ron

Share this post


Link to post
Share on other sites
Steve,

Effective May 14, packages over one cubic foot in volume will be charged either the actual weight or the dimensional weight, whichever is greater. This is designed to discourage shipping "balloon" packages. It won't affect many shippers. As a rule of thumb, if your rectangular packages weigh less than 9 lb/cubic foot, and you ship to zones 5-8, you will be subject to the surcharge. Depending on the density, you might incur a surcharge of a few dollars. Shippers of odd-shaped packages have a different calculation (DMM 123.1.4.2)

 

I don't foresee a problem in my shop, as the largest package I ship is a 12x12x12" box, and my packages of this size are typically about 15 pounds. If I wind up with a package subject to dimensional weight, I'll just eat the extra postage.

 

People shipping low value, low density (pillows, bubble wrap, packing peanuts, etc) packages will have problems, but most will be fine.

 

--Glen

 

Glen,

Thanks for the reply. I have a lot of packages that will be affected by this change so I am scrambling to make the correct changes. I have my files updated but have yet to run the SQL updates. I am a little confused on the SQL. I know I run them in myPHP but have a question. The instruction state the following...

 

Execute this SQL update:

 

ALTER TABLE `configuration` CHANGE `set_function` `set_function` VARCHAR( 555 ) CHARACTER SET latin1 COLLATE latin1_swedish_ci NULL DEFAULT NULL;

 

Execute this SQL update if you already have the module installed and are updating:

 

UPDATE `configuration` SET `set_function` = 'tep_cfg_select_multioption(array(''Global Express'', ''Global Express Non-Doc Rect'', ''Global Express Non-Doc Non-Rect'', ''Express Mail Int'', ''Express Mail Int Flat Rate Env'', ''Priority Mail Int'', ''Priority Mail Int Flat Rate Env'', ''Priority Mail Int Flat Rate Box'', ''First-Class Mail Int''),' WHERE `configuration_key` ='MODULE_SHIPPING_USPS_TYPES_INTL' LIMIT 1 ;

 

====================

 

My question is what exactly do I input for this change? Is this two separate commands? I already have this module installed so do I just run the second one listed? Sorry if this is a stupid question. Just not too up on this stuff.

 

Steve

Share this post


Link to post
Share on other sites
Glen,

Thanks for the reply. I have a lot of packages that will be affected by this change so I am scrambling to make the correct changes. I have my files updated but have yet to run the SQL updates. I am a little confused on the SQL. I know I run them in myPHP but have a question. The instruction state the following...

 

Execute this SQL update:

 

ALTER TABLE `configuration` CHANGE `set_function` `set_function` VARCHAR( 555 ) CHARACTER SET latin1 COLLATE latin1_swedish_ci NULL DEFAULT NULL;

 

Execute this SQL update if you already have the module installed and are updating:

 

UPDATE `configuration` SET `set_function` = 'tep_cfg_select_multioption(array(''Global Express'', ''Global Express Non-Doc Rect'', ''Global Express Non-Doc Non-Rect'', ''Express Mail Int'', ''Express Mail Int Flat Rate Env'', ''Priority Mail Int'', ''Priority Mail Int Flat Rate Env'', ''Priority Mail Int Flat Rate Box'', ''First-Class Mail Int''),' WHERE `configuration_key` ='MODULE_SHIPPING_USPS_TYPES_INTL' LIMIT 1 ;

 

====================

 

My question is what exactly do I input for this change? Is this two separate commands? I already have this module installed so do I just run the second one listed? Sorry if this is a stupid question. Just not too up on this stuff.

 

Steve

My previous information was in error. The set_function field is used by the configuration editor to present the selection options. If you are using a mySQL version below 5.0.3, you can change the data type to TEXT instead of VARCHAR(555).

 

These are two separate commands. You need to alter the table before you can update the configuration. Paste each one into an SQL query window in phpMyAdmin.

 

--Glen

Share this post


Link to post
Share on other sites
My previous information was in error. The set_function field is used by the configuration editor to present the selection options. If you are using a mySQL version below 5.0.3, you can change the data type to TEXT instead of VARCHAR(555).

 

These are two separate commands. You need to alter the table before you can update the configuration. Paste each one into an SQL query window in phpMyAdmin.

 

--Glen

 

Thanks Glen and I was able to figure that out the hard way. Nonetheless, I learned more about SQL in my efforts so not all is lost. The module is up and running fine on my sight. Thanks again.

 

Steve

Share this post


Link to post
Share on other sites

The 2.8d_1 update worked like charm.

 

Thanks a million grapesmuggler! You the man!

Edited by polaris

Share this post


Link to post
Share on other sites

Hello,

 

I'm trying to add Priority Mail Flat Rate Box to domestic services. Below are the modifications I made to modules/shipping/usps.php. Unfortunately, I'm not able to have the service to display among the other domestic shipping rates in checkout_shipping.php. May be somebody can help me with this. Any help would be appreciated.

$this->types = array('Express' => 'EXPRESS', 'First Class' => 'First-Class Mail', 'Priority' => 'Priority', 'Priority Mail Flat Rate Box' => 'Priority Mail Flat Rate Box', 'Parcel' => 'Parcel', 'BPM' => 'Bound Printed Material', 'Library' => 'Library', 'Media' => 'Media Mail');

........

tep_db_query("insert into " . TABLE_CONFIGURATION . " ( configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Domestic Shipping Methods', 'MODULE_SHIPPING_USPS_TYPES', 'Express, Priority, Priority Mail Flat Rate Box, First Class, Parcel, Bound Printed Material, Library, Media,', 'Select the domestic services to be offered:', '6', '14', 'tep_cfg_select_multioption(array(\'Express\', \'Priority\', \'Priority Mail Flat Rate Box\', \'First Class\', \'Parcel\',\'Bound Printed Material\',\'Library\',\'Media\'), ', now())");

Edited by Irin

Share this post


Link to post
Share on other sites

Just a wide guess. Don't kill me if I'm wrong.

 

I would check the following 2 things:

 

1. Priority Mail Flat Rate Box

 

I would want make sure this is what it is called in USPS API. make sure it is not called something like (i made that up) "Priority Mail Flat Box", etc. Because I would imagine that when the shipping quote was made to USPS WebTools Server and if this is un-recognized domestic mail type, it will return an error? thus for it not showing up. Are you able to see it in Admin panel? If you are able to see it in Admin but not able to see it in checkout.php. This might be the cause.

 

2. Remove the old module then install it again. Click the green button.

 

Hope this helps, I don't use flat rat box because it has a dimension limit and I have no way to tell whose order will fit in flat rate box whose will not.

Edited by polaris

Share this post


Link to post
Share on other sites
Just a wide guess. Don't kill me if I'm wrong.

 

I would check the following 2 things:

 

1. Priority Mail Flat Rate Box

 

I would want make sure this is what it is called in USPS API. make sure it is not called something like (i made that up) "Priority Mail Flat Box", etc. Because I would imagine that when the shipping quote was made to USPS WebTools Server and if this is un-recognized domestic mail type, it will return an error? thus for it not showing up. Are you able to see it in Admin panel? If you are able to see it in Admin but not able to see it in checkout.php. This might be the cause.

 

2. Remove the old module then install it again. Click the green button.

 

Hope this helps, I don't use flat rat box because it has a dimension limit and I have no way to tell whose order will fit in flat rate box whose will not.

Hi Alex,

 

If I'm not wrong, the Service is still called Priority but the Container is Flat Rate Box. Do you know how I can check USPS API for the correct service name just to make sure it recognizes the mail type? And yes, I can see it in Admin back end but not in checkout_shipping.php.

 

Thanks.

Share this post


Link to post
Share on other sites

You are correct Irin. It is just called Priority, with a container tag of "Priority Mail Flat Rate Box". I don't think you did anything wrong.

 

The work around will probably be to make changes to the XML parser. I didn't look deep into this contribution. Sorry not much help.

Share this post


Link to post
Share on other sites
My previous information was in error. The set_function field is used by the configuration editor to present the selection options. If you are using a mySQL version below 5.0.3, you can change the data type to TEXT instead of VARCHAR(555).

 

These are two separate commands. You need to alter the table before you can update the configuration. Paste each one into an SQL query window in phpMyAdmin.

 

--Glen

 

 

So what would the SQL Queries need to look like on a mySQL 4.x box? I'm trying to implement this and the standard query in the documentation fails with:

 

"#1074 - Too big column length for column 'set_function' (max = 255). Use BLOB instead "

 

So then I found this thread and specifically this post, and tried a couple things... first I tried:

 

ALTER TABLE `configuration` CHANGE `set_function` `set_function` TEXT( 555 ) CHARACTER SET latin1 COLLATE latin1_swedish_ci NULL DEFAULT NULL;

 

And received:

 

"#1064 - You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '( 555 ) CHARACTER SET latin1 COLLATE latin1_swedish_ci NULL DEF"

 

 

Then I tried:

 

ALTER TABLE `configuration` CHANGE `set_function` `set_function` TEXT CHARACTER SET latin1 COLLATE latin1_swedish_ci NULL DEFAULT NULL;

 

And received a similar error:

 

#1064 - You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'CHARACTER SET latin1 COLLATE latin1_swedish_ci NULL DEFAULT NUL

 

 

It appears the instructions don't apply to mySQL 4.x? Can anyone help me out with how to tweak it for this?


Jerry a.k.a. 'FoundSoul'

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

×