Jump to content
Latest News: (loading..)
Sign in to follow this  
primordialstuff

USPS Module Help Please!

Recommended Posts

THANK YOU DENNIS for pointing me to this contrib!!!!!

 

David

 

It didn't work for me at all...my site broke after adding this fix...I need a fix for the error message that I'm getting above....

Share this post


Link to post
Share on other sites
It didn't work for me at all...my site broke after adding this fix...I need a fix for the error message that I'm getting above....

 

Did you delete your old usps.php or just rename it. You HAVE to delete the old one before you install a new one. I think this is why it is trying to redeclare class usps.php since two files are trying to declare it.

Share this post


Link to post
Share on other sites
There is a fix in the contributions for insurance and it works:

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

 

Sincere thank you to bkpie and tarheit.

 

Dennis

 

Dennis / All,

 

I installed the insurance contrib and observed where the instructions stated the following:

"This adds insurance for Domestic Priority and Express Mail as well as International priority mail. It does not cover International Express Mail as I have not worked that out yet with all the variables."

The contrib works great for domestic. However, I have tested this against International Priority Mail and find no application of the defined insurance rates. The prices displayed to customers are the same no matter what you have in the insurance variables. Anyone else having this issue?

 

David


Anthony David

AllThingsTrendy.com

Share this post


Link to post
Share on other sites
Did you delete your old usps.php or just rename it. You HAVE to delete the old one before you install a new one. I think this is why it is trying to redeclare class usps.php since two files are trying to declare it.

 

I initially didn't read the instructions and uploaded the new one OVERWRITING the old one. Then, when that didn't work, I read the instructions (doh!), deleted the current one and uploaded the new one with no luck still....

 

Any ideas of how to fix it?

Share this post


Link to post
Share on other sites

In the admin of the USPS shipping module, all of my shipping type selections turn to "array" and my checkout will still not allow the use of USPS module. Is it possible that the upgrade.sql did something to the database? I even used files from an already repaired store and replaced the ones I got from the new updated usps module. Really need help badly.

Share this post


Link to post
Share on other sites
Dennis / All,

 

I installed the insurance contrib and observed where the instructions stated the following:

"This adds insurance for Domestic Priority and Express Mail as well as International priority mail. It does not cover International Express Mail as I have not worked that out yet with all the variables."

The contrib works great for domestic. However, I have tested this against International Priority Mail and find no application of the defined insurance rates. The prices displayed to customers are the same no matter what you have in the insurance variables. Anyone else having this issue?

 

David

 

David:

You are correct. No insurance for International mail in that USPS module. For most countries only Global Express, Priority Mail International Parcels and the like may be insured. Most of my shipments are by "First Class Mail International" so the insurance factor doessn't affect me most of the time.

Share this post


Link to post
Share on other sites

Wow I was about to install the USPS Contribution untill I read all of this. I am new to this and I need to launch tonight. I might be better off using a flat rate untill all of this crap is straightened out.

 

Would like to know how to do the SQL update, remember..... Im a rookie!!!!

 

Thanks guys

Brian

Share this post


Link to post
Share on other sites

Does any one have instructions for updating update.sql? How do you do this? Where is this? Database? File?

 

<_<

Share this post


Link to post
Share on other sites

Thanks everyone for the support on this.. I was having the same problem.. I made the changes to the code and ran the SQL update and then it didn't work at all.

 

So I went ahead and uninstalled it. and downloaded the updated module from

 

http://www.oscommerce.com/community/contri...ch,USPS+Methods

 

I used the USPS Methods 2.9.2 Upper Case Fix2

 

Uploaded the files to my site and reinstalled the module. Entered my username and password and

 

It's all working now!! even better than it was before in fact, so thanks to everyone for the info.. just thought I'd post my steps in the hopes that it helps someone else.. good luck!

 

-Mike

Share this post


Link to post
Share on other sites
Does any one have instructions for updating update.sql? How do you do this? Where is this? Database? File?

 

<_<

 

There are several ways to run SQL updates depending on access to the server.. my server is remote and supports MySQLAdmin which is a web module that allowes me to cut and paste and execute the SQL.

 

-Mike

Share this post


Link to post
Share on other sites

Hello everyone,

 

This just happened to me... and all is fine now

 

 

I downloaded off of my FTP program the usps.php module, and also did a copy of it so that I could keep the original just in case and work on the test copy!

 

I keep a folder on my computer called WEBSITE TEST

 

I saved a copy of the original as: usps.php

and copied it naming it to: uspstest.php

 

Then I worked on the TEST one...

 

and changed exactly what the others have said:

 

Changed exactly this:

 

'EXPRESS' => 'Express Mail',

'FIRST CLASS' => 'First-Class Mail',

'PRIORITY' => 'Priority Mail',

'PARCEL' => 'Parcel Post'

 

As before it used to be ALL Capitals followed by lower case for example:

 

'Express'=>'Express Mail'

 

Now it is: 'EXPRESS'=>'Express Mail'

 

Simply CAPITALIZE the FIRST options... then save your work

 

Upload it and OVERWRITE your present usps.php

 

Then test an order.. it should be corrected.

 

Remember once this works, get rid of your test etc that you saved

 

Allison

Share this post


Link to post
Share on other sites
Thanks everyone for the support on this.. I was having the same problem.. I made the changes to the code and ran the SQL update and then it didn't work at all.

 

So I went ahead and uninstalled it. and downloaded the updated module from

 

http://www.oscommerce.com/community/contri...ch,USPS+Methods

 

I used the USPS Methods 2.9.2 Upper Case Fix2

 

Uploaded the files to my site and reinstalled the module. Entered my username and password and

 

It's all working now!! even better than it was before in fact, so thanks to everyone for the info.. just thought I'd post my steps in the hopes that it helps someone else.. good luck!

 

-Mike

 

Mike,

 

Thanks for your post...I was able to get my shipping module up and running with two simple steps:

 

1. Delete the usps.php from includes/modules/shipping on my server

2. Upload the usps.php from the contrib in Mike's post to includes/modules/shipping

 

I did not have to run a SQL update on my database nor did I change any code. Everything is working perfectly. Hopefully, USPS doesn't decide to update their API anytime soon.

 

Nate

Share this post


Link to post
Share on other sites
Thanks everybody, you saved my arse again. That's what I love about Open Source community :) I wasn't the only one freaking out and whew...

 

All I did was edit my existing usps.php with the new stuff from the new contribution:

 

$this->types = array('EXPRESS' => 'EXPRESS', 'FIRST CLASS' => 'First-Class Mail', 'PRIORITY' => 'PRIORITY', 'PARCEL' => 'Parcel', 'BPM' => 'Bound Printed Material', 'LIBRARY' => 'Library', 'MEDIA' => 'Media Mail');

 

$this->intl_types = array('GLOBAL EXPRESS' => 'Global Express Guaranteed',

'GLOBAL EXPRESS NON-DOC RECT' => 'Global Express Guaranteed Non-Document Rectangular',

'GLOBAL EXPRESS NON-DOC NON-RECT' => 'Global Express Guaranteed Non-Document Non-Rectangular',

'EXPRESS MAIL INT' => 'Express Mail International (EMS)',

'EXPRESS MAIL INT FLAT RATE ENV' => 'Express Mail International (EMS) Flat Rate Envelope',

'PRIORITY MAIL INT' => 'Priority Mail International',

'PRIORITY MAIL INT FLAT RATE ENV' => 'Priority Mail International Flat Rate Envelope',

'PRIORITY MAIL INT FLAT RATE BOX' => 'Priority Mail International Flat Rate Box',

'FIRST-CLASS MAIL INT' => 'First-Class Mail International');

 

Then applied their update.sql:

 

UPDATE configuration

SET configuration_value = UPPER(configuration_value),

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';

 

UPDATE configuration

SET configuration_value = UPPER(configuration_value),

set_function='tep_cfg_select_multioption(array(''EXPRESS'', ''PRIORITY'', ''FIRST CLASS'', ''PARCEL'', ''BPM'', ''LIBRARY'', ''MEDIA''), '

WHERE configuration_key='MODULE_SHIPPING_USPS_TYPES'

 

Seems like it fixed it. Tested Domestic and international orders. Nice of USPS to warn us eh?

 

J

 

How do I do the update.sql?

Share this post


Link to post
Share on other sites
How do I do the update.sql?

I still have the same question as well. To those replying I think we all would like it in laymens terms. Simply saying "running mysql admin" doesn't seem to be helping us newbies.

Share this post


Link to post
Share on other sites

Hi,

 

it looks like there is a bug in the latest usps.php (USPS Methods 2.9.2 Upper Case Fix2+insurance) in line 209. This line need to be commented out since line 210 is the correct one. Otherwise you will end up having two records in the db and you get the wrong one by default.

 

Nevertheless has someone noticed that the PARCEL rates are wrong? For a 2lb parcel from zip to zip 94551 it gives me $6.67 where the USPS Postage Rate Calculator gives me $4.34 - Can anyone confirm that?

 

Thanks.

Share this post


Link to post
Share on other sites

I installed the mod and found it resetting to the top most shipping method all the time. So i made the changes posted here, capitalizing things, and running the SQL code. However now the customers get a price of $0.00 for express shipping. Anyone have an idea of where to look to fix this?

Share this post


Link to post
Share on other sites
Read this. It is a fix for the shipping module based off of your guys' posts.

http://forums.oscommerce.com/index.php?showtopic=284316

I followed the instructions here and it works but packages of less that 0.2lbs wind up displaying a price of $0.00. I talked with USPS technical support, and was told to "Ask OScommerce" that they had updated their prices in May of this year, and those changes may not be displayed. Anyone know where to start looking for how to fix this?

Share this post


Link to post
Share on other sites
I followed the instructions here and it works but packages of less that 0.2lbs wind up displaying a price of $0.00. I talked with USPS technical support, and was told to "Ask OScommerce" that they had updated their prices in May of this year, and those changes may not be displayed. Anyone know where to start looking for how to fix this?

 

Does it say free shipping on products that weight less than 0.2 lbs? I have a free shipping contrib installed but that shouldn't have anything to do with the code that I posted. I don't think the problem is on my end.

Share this post


Link to post
Share on other sites
Nevertheless has someone noticed that the PARCEL rates are wrong? For a 2lb parcel from zip to zip 94551 it gives me $6.67 where the USPS Postage Rate Calculator gives me $3.80 - Can anyone confirm that?

 

Thanks.

 

There seems to be another bug in the 'USPS Methods 2.9.2 Upper Case Fix2':

 

Line 95 needs to be changed from

if($shipping_pounds > 35 || $shipping_ounces < 6){

to

if($shipping_pounds > 35 || ($shipping_pounds == 0 && $shipping_ounces < 6)){

 

Machinable rates are now used correctly and ONLY if less than 0 pounds and 6 ounces or more than 35 pounds nonmachinable rates are used.

Share this post


Link to post
Share on other sites
Read this. It is a fix for the shipping module based off of your guys' posts.

http://forums.oscommerce.com/index.php?showtopic=284316

OK, I'm totally lost.

One says to change the usps.php then run the UPDATE.sql, another says to run the UPDATE.sql then change the usps.php. One says to Overwrite the usps.php, another says to delete it an replace it. Others say you only have to change the usps.php.

I have tried ALL methods and it still defaults to Express.

I'm using Godaddy, MySQL, phpMyAdministrator. I go to my Database and go to "Run SQL".

When I copy and paste the UPDATE.SQL and run it it returns # MySQL returned an empty result set (i.e. zero rows).

I know I'm not the only newbee having problems.

Can anyone explain why some only have to replace the usps.php, and others have to run the Update.sql and some of us still can't make it work?

I just got an answer from the letter I wrote to USPS last week and they say they are getting a ton of questions from osCommerce users.

Share this post


Link to post
Share on other sites

I ran into a problem installing the update. It was showing no configuration for international shipping methods in the admin interface and an error for international customers asking them contact the store owner to use USPS. Checking my PHP error log, I had one of these for each attempt:

 

PHP Parse error: parse error, unexpected T_GLOBAL, expecting ')' in /pathredacted/www/catalog/admin/modules.php(216) : eval()'d code on line 1

 

After some poking around, I was able to determine that the set_function column of the configuration table was a varchar(255). The update.sql change for MODULE_SHIPPING_USPS_TYPES_INTL is well over 255 characters. So, that field needs to be lengthened or changed to text.

 

Since a lot of other people are not mentioning this, I assume most people are running some other contribution or change that already altered that field length. I thought I would post a note, though, in case I could save someone else the annoyance of having to figure that out.

Share this post


Link to post
Share on other sites
OK, I'm totally lost.

One says to change the usps.php then run the UPDATE.sql, another says to run the UPDATE.sql then change the usps.php. One says to Overwrite the usps.php, another says to delete it an replace it. Others say you only have to change the usps.php.

I have tried ALL methods and it still defaults to Express.

I'm using Godaddy, MySQL, phpMyAdministrator. I go to my Database and go to "Run SQL".

When I copy and paste the UPDATE.SQL and run it it returns # MySQL returned an empty result set (i.e. zero rows).

I know I'm not the only newbee having problems.

Can anyone explain why some only have to replace the usps.php, and others have to run the Update.sql and some of us still can't make it work?

I just got an answer from the letter I wrote to USPS last week and they say they are getting a ton of questions from osCommerce users.

I referred to the above e-mail on my reply on the "HERE'S THE FIX" thread, instead of here, with other notes on variations in approaches. The main info for the newbie question is as follows:

 

It shouldn't really make much difference whether you run a sql update before or after changing the php file, as long as you do both. Not sure why you were getting the error you mentioned, but if you're running phpmyadmin, you should be able to find your store database (you may have more than one database set up on your server, I don't know), probably named something like "youruserid_p_os2 (63)" - click on it, then either click import if you're using a sql update file as in the contribution at the link directly above, or go to SQL and paste in the update info if you're just cutting and pasting.

 

If you go to the contribution link - http://addons.oscommerce.com/info/487 - and follow the instructions, it should work.

 

If you've performed custom alterations to your usps.php module, you'll have to do a file compare, and maybe strain your eyes and scratch your head a little.

Share this post


Link to post
Share on other sites

THANK YOU again everyone who contributes/ helps solve these problems that crop up. I have done the capitalization and it seems to work ok - what would I do without you all out there!

Share this post


Link to post
Share on other sites
I referred to the above e-mail on my reply on the "HERE'S THE FIX" thread, instead of here, with other notes on variations in approaches. The main info for the newbie question is as follows:

 

It shouldn't really make much difference whether you run a sql update before or after changing the php file, as long as you do both. Not sure why you were getting the error you mentioned, but if you're running phpmyadmin, you should be able to find your store database (you may have more than one database set up on your server, I don't know), probably named something like "youruserid_p_os2 (63)" - click on it, then either click import if you're using a sql update file as in the contribution at the link directly above, or go to SQL and paste in the update info if you're just cutting and pasting.

 

If you go to the contribution link - http://addons.oscommerce.com/info/487 - and follow the instructions, it should work.

 

If you've performed custom alterations to your usps.php module, you'll have to do a file compare, and maybe strain your eyes and scratch your head a little.

 

Thanks Colin,

I guess I know just enough to be REALLY Dangerous.

I got my files from the link you provided.

I only have one database. bk2gdb1

Went to SQL

I imported the Update.sql

It says "Run SQL query/queries on database bk2gdb1:"

In "FIELDS" on the right, it shows the correct fields in "Configuration"

When I run it, it gives me # MySQL returned an empty result set (i.e. zero rows).

Same as when I copied and pasted.

:'(

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
Sign in to follow this  

×