#2156 new
Eric Amundson

Error in USPS Standard Mail Rates

Reported by Eric Amundson | January 31st, 2013 @ 07:06 PM | in Add-on Modules

Howdy,

While working on m3tco.com/coregear today, we were testing the USPS shipping module where we have only two shipping methods selected within Shopp: USPS Priority Mail & USPS Standard Mail.

After numerous tests, it seems clear that the USPS Standard Mail rate is continually returning the Express Mail rate from USPS instead.

Illustration

Customer sells mister bottles that weight 21 ounces. So, we rated one from his origin zip, 92508 to the same zip and expected to see:

Priority Mail: $5.80
Standard Post: $5.80

What we received initially was:

Priority Mail: $5.80
Standard Post: $18.10 (this is the Express Mail rate)

Errors

No error message occurs; just returns incorrect shipping rate for Standard Post.

Steps to Repeat

I've fixed the USPS Rate add-on on the live site (www.m3tco.com/coregear), so the rates now agree. If you'd like to see the error in its natural habitat:

  1. Visit usamisters.ivykitten.com, which is in Maintenance Mode.
  2. Login using the username 'shopp', password '##########' redacted (without quotes)
  3. From the front end of the site, put a mister into your cart. (http://usamisters.ivykitten.com/our-products/coregear-mister-bottle/)
  4. Enter 92508 for the destination zip and update shipping
  5. Continue to checkout. You should see exactly what's in the attached screenshot.
Relevant Code

To 'fix' this issue, I opened the USPSRates.php file and changed the following block

     // Map the service IDs to internal service keys
    private $mapdomestic = array(
        '0' => 'FirstClass',
        '1' => 'Priority',
        '2' => 'Express',
        '3' => 'Standard',
        '5' => 'Standard',
        '6' => 'Media',
        '7' => 'Library'
    );

to read:


// Map the service IDs to internal service keys
    private $mapdomestic = array(
        '0' => 'FirstClass',
        '1' => 'Priority',
        '2' => 'Express',
        // '3' => 'Standard',
        '4' => 'Standard',
        // '5' => 'Standard',
        '6' => 'Media',
        '7' => 'Library'
    );@@@

I'm sure this isn't the most elegant solution, but it's now returning the results we expect to see.

##### Environment ######
Web Browser: **Chrome, FF**
Server OS: **Linux**
Web Server: **Apache**
PHP version: **5.2.17**
WordPress Version: **3.5.1**
Shopp Version: **1.2.5**
Shopp Install: **upgrade from latest version**

Comments and changes to this ticket

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.

New-ticket Create new ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile ยป

Plugin e-commerce for WordPress

Shared Ticket Bins

People watching this ticket

Referenced by