Zen Cart Logo
Forums / Addon Shipping Modules / USPS Shipping Module [Support Thread]

USPS Shipping Module [Support Thread]

Sticky

Views: 77,355

Results 101 to 120 of 447
9 Jun 2021, 6:57 PM
#101
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,096
Plugin Contributions:
56

USPS Shipping Module [Support Thread]

mikestaps:

Working on a "update" to 1.5.7c from a older version, and I can't get this module working properly.

All files in store are 1.5.7c, and a clean install of the USPS module was done.

Currently I am not getting any XML data returned...

USPS Debug contents:

2021-05-13 11:17:06: USPS build: 2021-05-05 K11a

Server: production
Quote Request Rate Type: Online
Quote from main_page: checkout_shipping
USPS Options (weight, time): --none--
USPS Domestic Transit Time Calculation Mode: NEW
Cart Weight: 0.8
Total Quote Weight: 3.8 Pounds: 3 Ounces: 13
Maximum: 50 Tare Rates: Small/Medium: 0:3 Large: 10:0
Handling method: Order Handling fee Domestic: $1.00 Handling fee International: $3.00
Decimals: 2
Domestic Length: 8.625 Width: 5.375 Height: 1.625
International Length: 8.625 Width: 5.375 Height: 1.625
All Packages are Machinable: False
Enable USPS First-Class filter for US shipping: True
Sorts the returned quotes: Price-LowToHigh

ZipOrigination: 48348
ZipDestination: Postcode: 48353 Country: United States City: Hartland State: Michigan
Order SubTotal: $25.00
Order Total: $26.50
Uninsurable Portion: $0.00
Insurable Value: $26.50

2021-05-13 11:17:06: Sending request to USPS

2021-05-13 11:17:07: ==================================

SENT TO USPS:

<RateV4Request USERID="XXX"><Revision>2</Revision>
<Package ID="0"><Service>PRIORITY COMMERCIAL</Service><ZipOrigination>48348</ZipOrigination><ZipDestination>48353</ZipDestination><Pounds>3</Pounds><Ounces>13</Ounces><Container>VARIABLE</Container><Size>REGULAR</Size><Value>26.50</Value><Machinable>FALSE</Machinable></Package>
<Package ID="1"><Service>EXPRESS COMMERCIAL</Service><ZipOrigination>48348</ZipOrigination><ZipDestination>48353</ZipDestination><Pounds>3</Pounds><Ounces>13</Ounces><Container>VARIABLE</Container><Size>REGULAR</Size><Value>26.50</Value><Machinable>FALSE</Machinable></Package>
</RateV4Request>

RESPONSE FROM USPS:

==================================
CommErr (should be 0): 0 -

==================================

USPS Country - $order->delivery[country][iso_code_2]: United States $this->usps_countries: US
Domestic Services Selected:

2021-05-13 11:17:07: RESPONSE FROM USPS:

============

RAW XML FROM USPS:

> 
> This is happening on both the test and production servers.
> 
> The store files are in a test folder on the site currently so they are not "public", I am wondering if the directory of the store is making a difference? or if it could be something else?
> 
> Any help would be GREATLY appreciated
Thanks to @mikestaps for granting me access to his site.  It 'looks like' the culprit is the site's CURL (v7.77.0) version.  Updating the following line (in the quoteLogCurlResponse class method):
    $message .= 'CommErr (should be 0): ' . $this->commErrNo . ' - ' . $this->commError[B] . ' - ' .  json_encode($this->commInfo)[/B] . "\n\n";
... indicated that the curl http-code returned was '400' (Bad Request).  That's why there's no XML returned for the quotes.  Not clear as to what CURL v7.77's issue(s) is/are, but it might be worth asking the webhost to downgrade the CURL version on the site.
8 Jul 2021, 6:17 AM
#102
justwade avatar

justwade

Zen Follower

Join Date:
Oct 2005
Posts:
206
Plugin Contributions:
0

Re: USPS Shipping Module [Support Thread]

I volunteer to help on a zen store and with this USPS plug in update I am not seeing how to do get the ground shipment only setting done. The ‘true’ code appears to be in the languages/english/modules/shipping/usps.php area and not where I set it before in includes/modules/shipping/usps.php code. We want everything to ship ground but not necessarily HAZMAT. How might I do this with this new code? I am using 1.55f and so far not seeing a field setting to ‘1’. And there is no logs for some odd reason although I did set it that way. Store is now getting a warning to refresh page when I go to cart. No USPS estimater. Updating from K10 version 9-6-2017 and worked still.
Thanks,

8 Jul 2021, 12:15 PM
#103
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,096
Plugin Contributions:
56

Re: USPS Shipping Module [Support Thread]

Justwade:

I volunteer to help on a zen store and with this USPS plug in update I am not seeing how to do get the ground shipment only setting done. The ‘true’ code appears to be in the languages/english/modules/shipping/usps.php area and not where I set it before in includes/modules/shipping/usps.php code. We want everything to ship ground but not necessarily HAZMAT. How might I do this with this new code? I am using 1.55f and so far not seeing a field setting to ‘1’. And there is no logs for some odd reason although I did set it that way. Store is now getting a warning to refresh page when I go to cart. No USPS estimater. Updating from K10 version 9-6-2017 and worked still.
Thanks,
I'm guessing that there's some kind of debug log present in the site's /logs subdirectory. If you post the contents of that myDEBUG*.log file, that should tell the story.

8 Jul 2021, 4:43 PM
#104
justwade avatar

justwade

Zen Follower

Join Date:
Oct 2005
Posts:
206
Plugin Contributions:
0

Re: USPS Shipping Module [Support Thread]

lat9:

I'm guessing that there's some kind of debug log present in the site's /logs subdirectory. If you post the contents of that myDEBUG*.log file, that should tell the story.

Ah, some of it is coming back to my brain, slowly. The log files populate later or overnight in my situation. With that here it is for a test local purchase;

2021-07-07 13:57:44: USPS build: 2021-05-05 K11a

Server: production
Quote Request Rate Type: Online
Quote from main_page: shopping_cart
USPS Options (weight, time): --none--
USPS Domestic Transit Time Calculation Mode: OLD
Cart Weight: 1.0625
Total Quote Weight: 1.221875 Pounds: 1 Ounces: 4
Maximum: 8 Tare Rates: Small/Medium: 15:0 Large: 10:3
Handling method: Order Handling fee Domestic: $3.95 Handling fee International: $20.00
Decimals: 2
Domestic Length: 8.625 Width: 5.375 Height: 1.625
International Length: 8.625 Width: 5.375 Height: 1.625
All Packages are Machinable: True
Enable USPS First-Class filter for US shipping: False
Sorts the returned quotes: Unsorted

ZipOrigination: 85224
ZipDestination: Postcode: 85205 Country: United States
Order SubTotal: $0.00
Order Total: $55.83
Uninsurable Portion: $0.00
Insurable Value: $55.83

2021-07-07 13:57:44: Sending request to USPS

2021-07-07 13:57:44: ==================================

SENT TO USPS:

<RateV4Request USERID="redacted"><Revision>2</Revision>
<Package ID="0"><Service>PARCEL</Service><ZipOrigination>85224</ZipOrigination><ZipDestination>85205</ZipDestination><Pounds>1</Pounds><Ounces>4</Ounces><Container>VARIABLE</Container><Size>REGULAR</Size><Value>55.83</Value><SpecialServices>  <SpecialService>106</SpecialService>
</SpecialServices><Machinable>TRUE</Machinable></Package>
</RateV4Request>


RESPONSE FROM USPS: 

==================================
CommErr (should be 0): 0 - 

==================================

USPS Country - $order->delivery[country][iso_code_2]: United States $this->usps_countries: US
Domestic Services Selected: 
USPS TrackingTM

2021-07-07 13:57:44: RESPONSE FROM USPS:
==================================
============

RAW XML FROM USPS:

SimpleXMLElement Object
(
    [Package] => SimpleXMLElement Object
        (
            [@attributes] => Array
                (
                    [ID] => 0
                )

            [Error] => SimpleXMLElement Object
                (
                    [Number] => -2147219385
                    [Source] => DomPostageLibrary;RateV4.ProcessRequest
                    [Description] => The requested Mail Service is only available when Ground Transportation is required, when the Zone is 5-9, or the mail piece is Oversized.
                    [HelpFile] => SimpleXMLElement Object
                        (
                        )

                    [HelpContext] => SimpleXMLElement Object
                        (
                        )

                )

        )

)

Thanks,

12 Jul 2021, 6:26 PM
#105
justwade avatar

justwade

Zen Follower

Join Date:
Oct 2005
Posts:
206
Plugin Contributions:
0

Re: USPS Shipping Module [Support Thread]

What we are trying to do is force ground shipment in all zones 1 - 9. This is the only way we ship anyway forcing such with the php as we did in the K10 version as advised by Ajeh. That code change made all shipment only ground but that was more than okay for us. It worked perfectly but I am not grasping how to do the same in this K11 version. I have researched the Admin and the forum but not found an answer so far. The new setting options appear to be there and may be obvious to others but not so much myself.

13 Jul 2021, 12:14 PM
#106
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,096
Plugin Contributions:
56

Re: USPS Shipping Module [Support Thread]

Justwade:

What we are trying to do is force ground shipment in all zones 1 - 9. This is the only way we ship anyway forcing such with the php as we did in the K10 version as advised by Ajeh. That code change made all shipment only ground but that was more than okay for us. It worked perfectly but I am not grasping how to do the same in this K11 version. I have researched the Admin and the forum but not found an answer so far. The new setting options appear to be there and may be obvious to others but not so much myself.
Could you point me to Ajeh's posting for the changes required for the previous versions of USPS?

13 Jul 2021, 10:24 PM
#107
justwade avatar

justwade

Zen Follower

Join Date:
Oct 2005
Posts:
206
Plugin Contributions:
0

Re: USPS Shipping Module [Support Thread]

I forget how to make a direct link but here is a quote with date stamp. The only change we made in /includes/modules/shipping/usps.php is change 'false" to 'true' as she described below. Worked perfect then and the later versions as I recall. But no other shipping is available which is okay.

12 Oct 2014, 04:43 AM #40

                                      **Re: USPS RateV4 Intl RateV2 - January 26, 2014 Issue**
To force Standard Post on all USPS shipping where no other shipping method will be available for Domestic shipping, you need to edit the USPS shipping module:

/includes/modules/shipping/usps.php

and change the code in **RED **around line 806 to true:
// force GroundOnly results in Stand Post only being offered
// to use, you must have a field for products_groundonly in the products table
// then uncomment the in_cart_check for the products_groundonly
// when $usps_groundonly is set to true, only Stand Post will show
$usps_groundonly = 'true';
// $usps_groundonly = ($_SESSION['cart']->in_cart_check('products_groundonly','1') ? 'true' : 'false');

Now, regardless of what shipping methods you have checked, be sure Standard Post is checked, only Standard Post will work for all USPS shipping and no other shipping method will work ...

                                                                     Linda McGrath

If you have to think ... you haven't been zenned ...

14 Jul 2021, 12:04 AM
#108
dbltoe avatar

dbltoe

Totally Zenned

Join Date:
Jan 2004
Location:
N of San Antonio TX
Posts:
9,799
Plugin Contributions:
15

Re: USPS Shipping Module [Support Thread]

Checkout line 51 of includes/languages/english/modules/shipping/usps.php and line 1154 (maybe the setting at line 58) of includes/modules/shipping/uspsphp.

Perhaps that will get you in the right direction. Although, you might want to watch out for the HAZMAT indication.

14 Jul 2021, 11:02 AM
#109
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,096
Plugin Contributions:
56

Re: USPS Shipping Module [Support Thread]

Justwade:

I forget how to make a direct link but here is a quote with date stamp. The only change we made in /includes/modules/shipping/usps.php is change 'false" to 'true' as she described below. Worked perfect then and the later versions as I recall. But no other shipping is available which is okay.
I've opened a GitHub issue (https://github.com/lat9/usps/issues/17) to track these changes in a subsequent USPS shipping-module release.

The change will be twofold.

First, edit /includes/modules/shipping/usps.php, making the highlighted changes:

    protected function _getQuote() 
    {
        global $order, $shipping_weight, $currencies;
        
        $package_id = 'USPS DOMESTIC RETURNED: ' . "\n";
        
        // -----
        // Force GroundOnly results in USPS Retail Ground only being offered.  See the shipping-module's
        // language file for additional information.
        //
        $usps_groundonly = '';
        if ([B]MODULE_SHIPPING_USPS_GROUNDONLY == 'force' || ([/B]MODULE_SHIPPING_USPS_GROUNDONLY == 'true' && $_SESSION['cart']->in_cart_check('products_groundonly', '1'[B])[/B])) {
            $usps_groundonly = '<Content><ContentType>HAZMAT</ContentType></Content><GroundOnly>true</GroundOnly>';
        }

and then create/edit a template-override of the shipping-module's language file, e.g. /includes/languages/english/modules/shipping/YOUR_TEMPLATE/usps.php, changing that 'soft' configuration value to 'force':

// -----
// Identifies whether/not a check for the database field 'products::products_groundonly' should be made.  If any products
// in the cart have that field set to '1', then the shipping request will indicate 'HAZMAT' contents and the
// shipping type will be forced to USPS Ground.  Valid values are 'true', 'false' (the default) or 'force' to force the USPS Ground shipping.
//
// NOTE: Setting this value to 'true' if that field doesn't exist in your database will result in a fatal MySQL error
// when the quote-request is made.
//
if (!defined('MODULE_SHIPPING_USPS_GROUNDONLY')) define('MODULE_SHIPPING_USPS_GROUNDONLY', '[B]force[/B]');
14 Jul 2021, 10:06 PM
#110
justwade avatar

justwade

Zen Follower

Join Date:
Oct 2005
Posts:
206
Plugin Contributions:
0

Re: USPS Shipping Module [Support Thread]

I edited the 2 files as you suggested, did a test purchase and the Ground Shipping now works perfect, Thank You Very Much!

We really do appreciate all the support.
I also put some coffee money up.

Thanks again! :smile:

23 Jul 2021, 2:27 PM
#111
mvstudio avatar

mvstudio

Zen Follower

Join Date:
Apr 2008
Posts:
447
Plugin Contributions:
1

Re: USPS Shipping Module [Support Thread]

Hello everyone.

Quick question. Is it possible to shorten the names of the shipping options to a more manageable size? The one I'm looking at shortening specifically is first class, which appears as - USPS (First-Class Package Service - Retail™ (2-5 b-days)). Because it's so long it messes up everything in the shopping cart when selected, especially on mobile. I shortened things as much as possible by eliminating the spaces in between 2 and 5 (2 - 5) and changing business days to b-days among other minor changes, but it's still ridiculously long. Ideally for the purpose of displaying the options to the customer First Class™ would suffice. Customers don't need that specific description of the service.

Thanks for the help!

2 Oct 2021, 1:45 PM
#112
janusr avatar

janusr

New Zenner

Join Date:
Jul 2015
Location:
United States
Posts:
3
Plugin Contributions:
0

Re: USPS Shipping Module [Support Thread]

v1.5.7c, USPS United States Postal Service - Version: 2021-05-05 K11a
Domestic shipping to U.S. works fine, as does international shipping to Canada and U.K., however, Australia and New Zealand does not work.
To demonstrate the issue, go to henriettashandbags.com, add any product to the shopping cart. From the shopping cart, scroll down to Shipping Cost section to enter country specifics, e.g. United States, Florida, 32955; Australia, Victoria, 3442.
This issue occurred with an older version of the U.S.P.S. module; updating to the latest version of this module yielded the same result.

2 Oct 2021, 4:24 PM
#113
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,096
Plugin Contributions:
56

Re: USPS Shipping Module [Support Thread]

JanusR:

v1.5.7c, USPS United States Postal Service - Version: 2021-05-05 K11a
Domestic shipping to U.S. works fine, as does international shipping to Canada and U.K., however, Australia and New Zealand does not work.
To demonstrate the issue, go to henriettashandbags.com, add any product to the shopping cart. From the shopping cart, scroll down to Shipping Cost section to enter country specifics, e.g. United States, Florida, 32955; Australia, Victoria, 3442.
This issue occurred with an older version of the U.S.P.S. module; updating to the latest version of this module yielded the same result.
It looks like, for whatever reason, USPS is limiting the shipping methods for shipping to Australia. I'd enabled all the international shipping methods and these are what was returned for a shipment to the AU:

United States Postal Service (Priority Mail Express International™)
United States Postal Service (Priority Mail Express International™ Flat Rate Envelope)
United States Postal Service (USPS GXG™ Envelopes)

3 Oct 2021, 2:26 PM
#114
dbltoe avatar

dbltoe

Totally Zenned

Join Date:
Jan 2004
Location:
N of San Antonio TX
Posts:
9,799
Plugin Contributions:
15

Re: USPS Shipping Module [Support Thread]

Google -- Is USPS suspending mail to Australia

Looks like Covid has them holding mail. Some reports since 2 September.

13 Oct 2021, 5:02 PM
#115
toomuchmusic avatar

toomuchmusic

New Zenner

Join Date:
Oct 2014
Location:
Massachusetts, United States
Posts:
21
Plugin Contributions:
0

Re: USPS Shipping Module [Support Thread]

Hello!

One of my customers is attempting to ship an order to New Zealand and is receiving an error. On step one of the checkout it will display the delivery information, but will show "this is currently the only shipping method available to use on this order" but without any shipping method options. When the user clicks on the "continue" button, it will not let then go next to select payment methods. I duplicated the issue by entering a New Zealand address into a logged in customer account.

Upon checking my error logs I receive the following PHP error: "Malformed value for session-based shipping module; customer will need to re-select: false" in my includes order php file. I looked into this issue, and could not find another similar posting.

I am operating on Zencart v1.5.7b and the latest version of the USPS shipping module (2021-05-05 K11a). I am not using zoned shipping and have received orders from outside the UK and Australia recently and from New Zealand in the past. Any help would be appreciated!

14 Oct 2021, 2:15 AM
#117
toomuchmusic avatar

toomuchmusic

New Zenner

Join Date:
Oct 2014
Location:
Massachusetts, United States
Posts:
21
Plugin Contributions:
0

Re: USPS Shipping Module [Support Thread]

Thank you! Glad to know it's not a site issue.

5 Nov 2021, 8:13 PM
#118
vdecals avatar

vdecals

Zen Follower

Join Date:
Jun 2009
Location:
Sparta, TN
Posts:
166
Plugin Contributions:
0

Re: USPS Shipping Module [Support Thread]

1.5.7c, clone-a-template, display logs, SiteMapXML.
I've just set up Square to take payments and found it does not have a shipping link to USPS (or I cannot find it) where I can ship directly from the payment/Square website (as does PayPal). Most of my shipping is free so I don't need quotes, but I would like to avoid manually typing in customer shipping addresses. I'm currently using "Zone Rates".

Will this USPS Shipping Module (and an activated USPS WebTools account) work behind the customer veil and allow me to ship directly from my site?

TIA

6 Nov 2021, 12:59 PM
#119
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,096
Plugin Contributions:
56

Re: USPS Shipping Module [Support Thread]

VDecalS:

1.5.7c, clone-a-template, display logs, SiteMapXML.
I've just set up Square to take payments and found it does not have a shipping link to USPS (or I cannot find it) where I can ship directly from the payment/Square website (as does PayPal). Most of my shipping is free so I don't need quotes, but I would like to avoid manually typing in customer shipping addresses. I'm currently using "Zone Rates".

Will this USPS Shipping Module (and an activated USPS WebTools account) work behind the customer veil and allow me to ship directly from my site?

TIA
If I understand your question, you're asking whether the USPS shipping module can create shipping labels for those packages. The answer to that question is "No", it only gathers the quotes from USPS.

6 Nov 2021, 1:21 PM
#120
swguy avatar

swguy

Administrator

Join Date:
Feb 2006
Location:
Tampa Bay, Florida
Posts:
10,703
Plugin Contributions:
56

Re: USPS Shipping Module [Support Thread]

VDecalS:

Most of my shipping is free so I don't need quotes, but I would like to avoid manually typing in customer shipping addresses.

Try my Copy Shipping Label contribution:
https://www.zen-cart.com/downloads.php?do=file&id=2274