Zen Cart Logo
Forums / Zen Cart Release Announcements / UPDATE: USPS January 4, 2010

UPDATE: USPS January 4, 2010

Locked

Views: 28,208

Results 1 to 5 of 5
This thread is locked. New replies are disabled.
4 Jan 2010, 8:28 PM
#1
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

UPDATE: USPS January 4, 2010

USPS has updated their code for January 4, 2010

This Zip file is for v1.3.8/v1.3.8a for the RateV3 and new shipping methods

NOTE: You will need to do a REMOVE, INSTALL and Configure for the changes to take effect ...

NOTE: for older versions (prior to 1.3.x), try changing the line:

class usps extends base {

to read:

class usps {
6 Jan 2010, 6:38 AM
#2
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: UPDATE: USPS January 4, 2010

A minor ADDITIONAL change is needed to the January 4, 2010 update that affects International Shipping, when ounces are extended beyond 5 digits.

The change is minor and can be done without the need to reinstall the code by changing the line at 160 from:

    $shipping_ounces = (16 * ($usps_shipping_weight - floor($usps_shipping_weight)));

to now read:

    $shipping_ounces = (16 * ($usps_shipping_weight - floor($usps_shipping_weight)));
    // usps currently cannot handle more than 5 digits on international
    $shipping_ounces = zen_round($shipping_ounces, 3);

This does not affect the regular US shipping quotes only the International shipping quotes.

This should be the last change needed for this file ... I hope ... :lamo:

9 Jan 2010, 9:41 PM
#3
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: UPDATE: USPS January 4, 2010

There are a few additional changes for the January 4 2010 USPS Update ...

To ensure that you have the correct code, be sure to go to the Modules ... Shipping ...

1 Save your current settings to NotePad

2 REMOVE the current module

3 Load the new usps.php file to the server with your FTP software

4 INSTALL the new module

5 Reconfigure the module for your settings

12 Jan 2010, 2:58 PM
#4
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: UPDATE: USPS January 4, 2010

For anyone needing the International Global Express Envelopes - USPS GXG Envelopes, add the line:

    $this->intl_types = array(
        'Global Express' => 'Global Express Guaranteed (GXG)',
        'Global Express Non-Doc Rect' => 'Global Express Guaranteed Non-Document Rectangular',
        'Global Express Non-Doc Non-Rect' => 'Global Express Guaranteed Non-Document Non-Rectangular',
        'Global Express Envelopes' => 'USPS GXG Envelopes',
        'Express Mail Int' => 'Express Mail International',
        'Express Mail Int Flat Rate Env' => 'Express Mail International Flat Rate Envelope',
        'Priority Mail International' => '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',
        'Priority Mail Int Flat Rate Small Box' => 'Priority Mail International Small Flat Rate Box',
        'Priority Mail Int Flat Rate Med Box' => 'Priority Mail International Medium Flat Rate Box',
        'Priority Mail Int Flat Rate Lrg Box' => 'Priority Mail International Large Flat Rate Box',
        'First Class Mail Int Lrg Env' => 'First-Class Mail International Large Envelope',
        'First Class Mail Int Package' => 'First-Class Mail International Package',
        'First Class Mail Int Letter' => 'First-Class Mail International Letter'
        );

and change the line to read:

    $db->Execute("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('International Shipping Methods', 'MODULE_SHIPPING_USPS_TYPES_INTL', 'Global Express, Global Express Non-Doc Rect, Global Express Non-Doc Non-Rect, Global Express Envelopes, Express Mail Int, Express Mail Int Flat Rate Env, Priority Mail International, Priority Mail Int Flat Rate Env, Priority Mail Int Flat Rate Small Box, Priority Mail Int Flat Rate Med Box, Priority Mail Int Flat Rate Lrg Box, First Class Mail Int Lrg Env, First Class Mail Int Package, First Class Mail Int Letter', 'Select the international services to be offered:', '6', '15', 'zen_cfg_select_multioption(array(\'Global Express\', \'Global Express Non-Doc Rect\', \'Global Express Non-Doc Non-Rect\', \'Global Express Envelopes\', \'Express Mail Int\', \'Express Mail Int Flat Rate Env\', \'Priority Mail International\', \'Priority Mail Int Flat Rate Env\', \'Priority Mail Int Flat Rate Small Box\', \'Priority Mail Int Flat Rate Med Box\', \'Priority Mail Int Flat Rate Lrg Box\', \'First Class Mail Int Lrg Env\', \'First Class Mail Int Package\', \'First Class Mail Int Letter\'), ',  now())");

Be sure to follow the steps of:
1 Save your settings to USPS shipping module

2 REMOVE the USPS shipping module

3 INSTALL the USPS shipping module

4 Reconfigure the USPS shipping module

28 Jan 2010, 11:24 PM
#5
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: UPDATE: USPS January 4, 2010

For some people, USPS is not recognizing 5 digits as 5 digits where it should see as 5 digits:
.12345
1.2345
12.345

this is not consistently ...

Until they are using 5 digits as 5 digits, you may need to change the calculation on the ounces from:

    $shipping_ounces = (16 * ($usps_shipping_weight - floor($usps_shipping_weight)));
    // usps currently cannot handle more than 5 digits on international
    $shipping_ounces = zen_round($shipping_ounces, 3);

to read:

    $shipping_ounces = (16 * ($usps_shipping_weight - floor($usps_shipping_weight)));
    // usps currently cannot handle more than 5 digits on international
    $shipping_ounces = zen_round($shipping_ounces, [B]2[/B]);