Jump to content
bad_lemming

[Contribution] - USPS Methods

Recommended Posts

15 of one item isn't pratical as its vehicle specific and no one needs more then say 2 if they have 2 of the same vehicles. I haven't added a weight threshold because I didn't need to in the past until the update. Trying to keep from having to change 100's of items lol.

 

I have the threshold set to 0.00 or above. The item weight is entered. If I select flat rate envelope only in admin I get the error previously posted. If I select priority in Admin. The error does not occur and it gives a price. Any ideas?

Share this post


Link to post
Share on other sites

15 of one item isn't pratical as its vehicle specific and no one needs more then say 2 if they have 2 of the same vehicles. I haven't added a weight threshold because I didn't need to in the past until the update. Trying to keep from having to change 100's of items lol.

 

I have the threshold set to 0.00 or above. The item weight is entered. If I select flat rate envelope only in admin I get the error previously posted. If I select priority in Admin. The error does not occur and it gives a price. Any ideas?

 

The method isn't going to pass if the weight isn't set below the threshold. What do you mean zero or above? Did you leave the max empty? Set it to 1 and try that. Or, set it to exactly what you have priority set to if priority is working. Why is flat rate not working and regular priority is working? I don't know. I'd have to see your admin settings to chime in on that. But if one is working and one isn't, then it makes sense to mimic the one that is working.

Share this post


Link to post
Share on other sites

Thank you, I set the max to 70 like the priority mail and works great for US residents.

 

However for international I now get this error " An error occured with the USPS shipping calculations.

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

 

If I allow flat rate small boxes it works, but not with the envelope.

Edited by rcbro

Share this post


Link to post
Share on other sites

Thank you, I set the max to 70 like the priority mail and works great for US residents.

 

However for international I now get this error " An error occured with the USPS shipping calculations.

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

 

If I allow flat rate small boxes it works, but not with the envelope.

 

The fix for international flat rate envelope is in the contributions - dated Feb 9:

 

International envelope options aren't being returned in 5.2.1 module. To fix, change code below. The upload includes only a text file with the same instructions.

 

in catalog/includes/modules/shipping/usps.php

 

on about line 723, change

'<MailType>Package</MailType>'

to

'<MailType>All</MailType>'

Share this post


Link to post
Share on other sites

The fix for international flat rate envelope is in the contributions - dated Feb 9:

 

Thank you, I missed that post. Its hard to gather all the good info on this site. That fixed my issues!

Share this post


Link to post
Share on other sites

Just want to note that while checking on something today, I ran into problems with USPS. I use one page checkout and it is lagging due to problems setting the shipping method. Domestic first-class mail is calculating, but it is not applying to the cart correctly. I had a first class order come through last night and it was perfect and seamless. But, while testing today, I had problems. THEN, USPS isn't returning rates at all - the error is "<Description>An unexpected system error has occurred. Please try again later or contact the System Administrator. </Description>". Then it works, but first-class isn't applying again. Then, it works perfectly, with returned rates and they are all applying to the cart. So, my ultimate guess is that the USPS server is being a little wacky, which is something beyond our settings or the module code.

 

Just wanted to give a head's up to anyone experiencing problems. It is possible for a customer to choose first class - which gets the proper returned rate, but applies to the cart as free shipping and they can successfully checkout this way. But, the problem isn't with the module. If it were, then the issue would be consistent, but it is changing with each refresh (with no changes on my end at all). Best course of action until this resolves itself is to turn off first class mail to avoid customers getting through with free shipping by choosing first class. They'll be forced to pay for upgraded priority mail, but it is easier to refund a few dollars than to pay shipping out of pocket. Hopefully, the servers will resolve themself in short order.

Share this post


Link to post
Share on other sites

I was watching USPS go up and down like a yo-yo while I was working on some issues with the UPSXML contribution the other day. I thought it was just me. Thanks for the sanity check.

 

~VId

Share this post


Link to post
Share on other sites

And thank you as well. When I got the dreaded "u: 0.00" in place of "First Class Mail Package: $X.XX" I just about freaked out, thinking maybe I did something to my site while working on something else. But, I hadn't even worked on that site. So, when it turned out to be sporadic, I figured it'd be better to post something and wait it out. All seems to be well today.

Share this post


Link to post
Share on other sites

I just finished installing USPS 5.2.1 and I am having the same problem. I am running 2.2 RC2a with one page checkout. When an order gets to the checkout.php page, all of my shipping methods appear correctly but the USPS methods do not appear correctly in the price calculations. No matter which USPS method I choose, the price shows up as: u:0.00. All other shipping methods such as Flat Rate or Per Item Rate show up correctly. Does anyone have any solutions? Thanks in advance

Share this post


Link to post
Share on other sites

Hello and thanks for the contribution. I am receiving the u: 0.00 and I was wondering if there were any database modifications needed when upgrading from 4.3.2 to version 5.2.1? Thanks in advance.

Share this post


Link to post
Share on other sites

Any db modifications will occur with the uninstall and reinstall. Did you uninstall old module before uploading new files and installing the new module. If not, then you need to uninstall, go into your sql and search USPS in the configuration table, deleting all entries, then reinstall the module.

 

Is this affecting only first class? If so, then go up three posts. USPS server has been a little wacky and it seems to be affecting only first class mail.

Share this post


Link to post
Share on other sites

Thank you very much for getting back to me so quickly. I did not uninstall the USPS module before uploading the modified files. I will search the database as you suggested. The problem is with all USPS shipping options. The correct price is displayed but whatever USPS shipping choice I make, I get a u: 0.00 in the total column. If I choose a different shipping method such as Flat Rate or Per Item Rate, the price displays correctly. Thanks again.

Share this post


Link to post
Share on other sites

And just as everyone thought they were all set to go, I've uploaded another contribution.

 

5.2.2

April 7, 2011 by Fulluv Scents

removed option to insure shipping cost - it didn't work correctly

fixed international envelope options - they weren't showing

fixed delivery and signature confirmation to coincide with retail/internet options

they were previously calculating at retail regardless of whether admin

chose retail or internet rates. Thanks BigGeorge for pointing it out.

added military mail responses - will go into affect on April 17, 2011

added alternate instructions for setting time zone (for servers that won't accept ini_set)

 

If installing over 5.2.1, then save your USPS login ID, uninstall from admin, replace one file (catalog/includes/modules/shipping/usps.php), reinstall from admin, and reset your configuration.

 

This will fix the upcoming change to military mail responses, and will lay to rest any questions about which module to install.

 

This mod should get us by until the next rate change, server change, or response change.

 

If someone would like to modify it for 2.3.1 and upload the exact same package HERE, that would be great!! I don't have 2.3.1 installed as a dev anymore, and the hassle is more than I have time to deal with right now.

Share this post


Link to post
Share on other sites

Damn. I just tried the previous version that you uploaded and I thought I had it when all of a sudden....

 

 

Fatal error: Call to undefined function: tep_round_up() in /nfs/c01/h06/mnt/35451/domains/bunnywarez.com/html/catalog/includes/modules/shipping/usps.php on line 343

 

 

I've updated all of the files as outlined in your instructions and double-checked my work. I confirmed that the round_up function is residing in the general.php file, too.

 

 

 

I guess I'll undo all of my work and try again, unless you have a suggestion. :'(

Share this post


Link to post
Share on other sites

I just did a reinstall of the latest code and...

 

 

After entering in my USPS User ID, the field reads "Array"

 

 

And I still get:

 

Fatal error: Call to undefined function: tep_round_up() in /nfs/c01/h06/mnt/35451/domains/bunnywarez.com/html/catalog/includes/modules/shipping/usps.php on line 343

 

 

 

EDIT:

 

actually, most everything in the USPS module interface is reading as "Array." Did I miss a database update somewhere in the instructions?

Edited by jovino

Share this post


Link to post
Share on other sites

Here's a follow-up to my update dilemma:

 

 

I modified /catalog/includes/modules/shipping/usps.php to use function tep_round() instead of the new function tep_round_up(). This got my site is working again, but I have no idea why tep_round_up() wasn't being found when it was there.

 

 

As for the USPS admin interface, I had to make database modifications directly through a PHP MySQL interface to get the values to stick. It was a serious pain, but at least my site works again. I don't know if I missed some sort of database update or if the whole thing got confused while trying to update the site. I did several uninstalls and reinstalls to try and rectify the issue, but I think its something else happening that I don't understand.

 

 

 

 

 

 

 

Thanks to everyone for their hard work on this contribution. I really appreciate it. I wish my code skills weren't so atrophied because I'm sure it would have been much easier to manage my store. I'd love it if all this stuff worked as simply as it should, but I guess I get what I pay for, huh?

Share this post


Link to post
Share on other sites

the tep_round_up function should be defined in:

 

store/includes/functions/general.php

 

NOT

 

store/admin/includes/functions/general.php

 

They are two different files with two different modifications needed. This is the biggest mix up that happens with this install and is the most likely culprit here.

Share this post


Link to post
Share on other sites

Ahhh, yes! I see the error of my ways!

 

 

tep_round_up() is all good, but the database is still fuxxored. I just went back in and did a manual update through PHP MySQL to fix all of that. Heh. At least I can pull that off. :)

 

 

I found an HTML nesting error on your output code. I'll post a block of code here after I grab a bite to eat.

Share this post


Link to post
Share on other sites

checkout_shipping.php

 

replace:

 

<?php
if ( ($n > 1) || ($n2 > 1) ) {
?>
<td align="right"><p><strong><?php echo $currencies->format(tep_add_tax($quotes[$i]['methods'][$j]['cost'], (isset($quotes[$i]['tax']) ? $quotes[$i]['tax'] : 0))); ?></p></strong></td>

<?php
} else {
?>
<td align="right" colspan="2"><p><?php echo $currencies->format(tep_add_tax($quotes[$i]['methods'][$j]['cost'], $quotes[$i]['tax'])) . tep_draw_hidden_field('shipping', $quotes[$i]['id'] . '_' . $quotes[$i]['methods'][$j]['id']); ?></p></td>
<?php
}
?>

 

with:

<?php
if ( ($n > 1) || ($n2 > 1) ) {
?>
<td align="right"><p><strong><?php echo $currencies->format(tep_add_tax($quotes[$i]['methods'][$j]['cost'], (isset($quotes[$i]['tax']) ? $quotes[$i]['tax'] : 0))); ?></strong></p></td>

<?php
} else {
?>
<td align="right" colspan="2"><p><?php echo $currencies->format(tep_add_tax($quotes[$i]['methods'][$j]['cost'], $quotes[$i]['tax'])) . tep_draw_hidden_field('shipping', $quotes[$i]['id'] . '_' . $quotes[$i]['methods'][$j]['id']); ?></p></td>
<?php
}
?>

Edited by jovino

Share this post


Link to post
Share on other sites

Yeah, it sounds like the old db entries are conflicting with the new entries.

 

I have tried your suggestion and I am still receiving a u: 0.00 in the totals column on the checkout page (one page checkout). I have checked over all of my code and it looks correct. I am stumped. Thanks.

Share this post


Link to post
Share on other sites

I am still having the same problems. On the checkout page, all of the information from USPS shows up correctly but no matter which USPS shipping method I choose, it shows u: 0.00 in the totals column. I have installed the latest version 5.2.2. I had 4.3.2 version previously. If I choose to ship via flat rate, the numbers appear in the total column correctly.

I noticed when comparing databases (old version configuration table with new version) that the new configuration table does not have the key: MODULE_SHIPPING_USPS_PASSWORD The old configuration did have this key. Could that be the problem? If I search the table: configuration, how many matches should I show for USPS? Thanks in advance.

Share this post


Link to post
Share on other sites

The password is not used by USPS on the rate v4 server, so it was removed with the 5.XX versions.

 

It's supposed to be 30 altogether when installed. One is the installed modules key, the remaining 29 are the USPS mod keys. If you didn't uninstall prior to installing the new mod, you might have the correct number, but the wrong entries, or more likely, you will have too many keys, with conflicting duplicates. Uninstall the mod from admin, delete all usps configuration entries in the db, and then reinstall the mod from admin. That is the easiest and fastest way to update the db and remove all conflicting entries. You don't want to compare the new entries to old entries, as this is counterproductive. They are not supposed to be the same.

 

If that doesn't work, then please go back through the instructions and make sure nothing was missed. You are getting responses, but they aren't posting to the cart. That means that there is a problem with the service names, which usually stems from mismatched or conflicting db entries. But if your db is correct, then something was missed in the instructions. If you still can't find the problem, then PM me.

Share this post


Link to post
Share on other sites

Having trouble getting this installed correctly. Using v.2.3.1 with USPS Methods 5.2.2.

 

Think we've properly installed the contribution, but when we go to click Install Module, USPS Methods doesn't show up nor is the frame with the edit options for each module visible. We uninstalled the USPS module prior to installation, and but didn't actually delete any files on the back end. Nor have we done any edits to the db. Rest of Admin appears to be working ok, including other modules like Payment.

 

I'm sure this is a simple fix, but where would we go to find out where the fault lies?

 

Thanks for your help!

Edited by jsherbanee

Share this post


Link to post
Share on other sites

Having trouble getting this installed correctly. Using v.2.3.1 with USPS Methods 5.2.2.

 

Think we've properly installed the contribution, but when we go to click Install Module, USPS Methods doesn't show up nor is the frame with the edit options for each module visible. We uninstalled the USPS module prior to installation, and but didn't actually delete any files on the back end. Nor have we done any edits to the db. Rest of Admin appears to be working ok, including other modules like Payment.

 

I'm sure this is a simple fix, but where would we go to find out where the fault lies?

 

Thanks for your help!

 

Also wanted to mention we have the FedEx module currently installed and it is still working fine and editable.

 

Thanks!

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

×