Results 1 to 10 of 21

Hybrid View

  1. #1
    Join Date
    Jan 2008
    Location
    Essex, MA
    Posts
    41
    Plugin Contributions
    0

    red flag USPS Rounding Errors -- Should never round down

    Cart Version: 1.3.8a

    OK before anybody asks, please note that all my tare settings are off (0:0) and therefore the weights of my products alone determine the shipping calculation. I also include a $1.00 handling fee with each order.

    That said, there are clear rounding errors with USPS shipping module. If you use this T-shirt as an example and add a size Large to the shopping cart, you'll see that it weighs a total of 0.482lbs. When converted to ounces, this is 7.712 which USPS requires be rounded up to 8.0. The USPS shipping module, in this example, rounds correctly and the total shipping charge for 1st Class Mail is $3.41.

    NOW, remove that item from the cart and re-add the same T-shirt in a size Medium. This product weighs a total of 0.452lbs, or 7.264 ounces when converted. Problem here is that the shipping module only wants to charge $3.24 for shipping, which means it is only considering it to be a 7-ounce item... THIS IS WRONG.

    The module should always be rounding up to the nearest whole ounce since this is how the USPS operates. Can someone please tell me where in the code I can update this rounding routine?


    Thanks in advance,
    -Dan

  2. #2
    Join Date
    Jan 2008
    Location
    Essex, MA
    Posts
    41
    Plugin Contributions
    0

    Default Re: USPS Rounding Errors -- Should never round down

    Anybody...?

  3. #3
    Join Date
    Jan 2008
    Location
    Essex, MA
    Posts
    41
    Plugin Contributions
    0

    Default Re: USPS Rounding Errors -- Should never round down

    So no admins actually care that the USPS Shipping Module simply does NOT function correctly? Say it ain't so.....

  4. #4
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    69,402
    Plugin Contributions
    6

    Default Re: USPS Rounding Errors -- Should never round down

    Google says ...
    0.482 pounds = 7.71200 ounces

    0.452 pounds = 7.23200 ounces

    Could you also post your Ship From and Ship To so we are comparing apples and apples?
    Linda McGrath
    If you have to think ... you haven't been zenned ...

    Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!

    Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today: v1.5.5]
    Officially PayPal-Certified! Just click here

    Try our Zen Cart Recommended Services - Hosting, Payment and more ...
    Signup for our Announcements Forums to stay up to date on important changes and updates!

  5. #5
    Join Date
    Jan 2008
    Location
    Essex, MA
    Posts
    41
    Plugin Contributions
    0

    Default Re: USPS Rounding Errors -- Should never round down

    Ajeh, you're right about what Google says, 0.452 lbs is 7.232 ounces... a typo in my post, but it doesn't actually change anything. It's over 7 ounces, therefore USPS will automatically charge you at the 8-ounce rate, which for 1st Class Mail would be $2.41. And it's still apples to apples since USPS First Class Mail isn't determines by zip code.

    So you see, it shouldn't matter whether my package weighs 7.712 or 7.232 ounces, either way ZC should calculate the shipping charge based on 8-ounces. Unfortunately, this doesn't appear to be what's happening.

    Instead, it assigns the correct $2.41 charge to the package weighing 7.781, which I assume is because, simply enough, the routine correctly rounded up to 8.000. But then ZC only assigns a $2.24 charge (the USPS 7-ounce rate) to the package weighing 7.232, even though the USPS requires that I ship it at the 8-ounce rate. Here I suspect it's just a matter of the Shipping Module rounding down from 7.232 when in fact it should still round up to 8.000 as well.

    If it were up to me and I knew where exactly I could tweak the code, I'd make it so the module would round up for anything that's, say, 0.050 over the full-ounce mark.


    Did that all make sense?
    Last edited by TraderDan; 11 Jul 2009 at 05:54 AM.

  6. #6
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    69,402
    Plugin Contributions
    6

    Default Re: USPS Rounding Errors -- Should never round down

    Look in the usps.php shipping module and tweak the calculation on the pounds and ounces to the way you want it to work ...

    We will look further into this for a future release ...
    Linda McGrath
    If you have to think ... you haven't been zenned ...

    Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!

    Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today: v1.5.5]
    Officially PayPal-Certified! Just click here

    Try our Zen Cart Recommended Services - Hosting, Payment and more ...
    Signup for our Announcements Forums to stay up to date on important changes and updates!

  7. #7
    Join Date
    Dec 2008
    Posts
    3
    Plugin Contributions
    0

    Default Re: USPS Rounding Errors -- Should never round down

    So no admins actually care that the USPS Shipping Module simply does NOT function correctly? Say it ain't so.....

  8. #8
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    69,402
    Plugin Contributions
    6

    Default Re: USPS Rounding Errors -- Should never round down

    TraderDan, that is still not the right file ...

    If you edit the file, you will see it contains on line 3:
    * USPS Module for Zen Cart v1.3.x, revised May 12, 2008 for new USPS rates effective May 12, 2008
    And that the ID on line 9 is:
    * @version $Id: usps.php 8516 2008-05-13 01:56:07Z drbyte $
    Get the USPS May 12 2008 download and load it to the directory:
    /includes/modules/shipping

    If you then search it and get the wrong date, delete the file on the server ... and then load it ...
    Linda McGrath
    If you have to think ... you haven't been zenned ...

    Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!

    Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today: v1.5.5]
    Officially PayPal-Certified! Just click here

    Try our Zen Cart Recommended Services - Hosting, Payment and more ...
    Signup for our Announcements Forums to stay up to date on important changes and updates!

  9. #9
    Join Date
    Jan 2008
    Location
    Essex, MA
    Posts
    41
    Plugin Contributions
    0

    Default Re: USPS Rounding Errors -- Should never round down

    OK, I have finally got this thing figured out, and here's what the problem was:

    I had moved the entire ZC storefront into a different sub-directory on my site a little while ago. In doing so, I overlooked a couple settings in the configure.php file like the COMPLETE path for example... it was still pointing to the older files. This is why even though I performed the USPS update, that the Toolkit was still finding the old stuff when I searched. I finally noticed that the full path I was looking at in the results was not right, and that tipped me off.

    So yeah, I double-checked all my config settings to ensure all references to the path were correctly pointing to the new store directory. Once that was done I went and removed, updated, and re-installed the USPS module one last time and now it appears to be working like it should. Not sure yet if it's rounding properly in every case (more on that soon), but the First Class International option appears to be functioning soundly.

    Thanks for taking the time to help, Ajeh, and sorry to have wasted any of your time.

 

 

Similar Threads

  1. v153 Admin rounding errors
    By strelitzia in forum Bug Reports
    Replies: 10
    Last Post: 6 Sep 2017, 09:13 AM
  2. Round errors when calculating prices
    By dr_james_leo in forum General Questions
    Replies: 2
    Last Post: 18 Nov 2011, 11:00 AM
  3. USPS never errors on bad zip
    By split63 in forum Built-in Shipping and Payment Modules
    Replies: 1
    Last Post: 1 Jul 2010, 08:58 AM
  4. Rounding up and rounding down how to stop this?
    By Kazz in forum Currencies & Sales Taxes, VAT, GST, etc.
    Replies: 9
    Last Post: 24 Jul 2008, 06:40 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg
Zen-Cart, Internet Selling Services, Klamath Falls, OR