Forums / Addon Shipping Modules / myDEBUG: USPS quote errors

myDEBUG: USPS quote errors

Results 1 to 9 of 9
19 Aug 2014, 22:40
#1
rixstix avatar

rixstix

Totally Zenned

Join Date:
Aug 2009
Posts:
2,015
Plugin Contributions:
0

myDEBUG: USPS quote errors

Upgraded Aug 3 from v1.3.9H to v1.5.3

All has been functioning error free until Aug 17 when php was upgraded from 5.3.28 to 5.4.31. PHP settings is beyond my paygrade. DrByte said that php upgrade to any stable version should not cause any problems.

It's probably safe to assume that the error is php version related.

[19-Aug-2014 12:08:29 America/Los_Angeles] #1 usps->quote() called at [/home/chainwea/public_html/includes/classes/shipping.php:140]
#2 shipping->quote() called at [/home/chainwea/public_html/includes/modules/pages/checkout_shipping/header_php.php:188]
#3 require(/home/chainwea/public_html/includes/modules/pages/checkout_shipping/header_php.php) called at [/home/chainwea/public_html/index.php:36]

[19-Aug-2014 12:08:29 America/Los_Angeles] PHP Warning: Illegal string offset 'ServiceName' in /home/chainwea/public_html/includes/modules/shipping/usps.php on line 437
[19-Aug-2014 12:08:29 America/Los_Angeles] #1 usps->quote() called at [/home/chainwea/public_html/includes/classes/shipping.php:140]
#2 shipping->quote() called at [/home/chainwea/public_html/includes/modules/pages/checkout_shipping/header_php.php:188]
#3 require(/home/chainwea/public_html/includes/modules/pages/checkout_shipping/header_php.php) called at [/home/chainwea/public_html/index.php:36]

[19-Aug-2014 12:08:29 America/Los_Angeles] PHP Warning: Illegal string offset 'ServiceName' in /home/chainwea/public_html/includes/modules/shipping/usps.php on line 437
[19-Aug-2014 12:08:29 America/Los_Angeles] #1 usps->quote() called at [/home/chainwea/public_html/includes/classes/shipping.php:140]
#2 shipping->quote() called at [/home/chainwea/public_html/includes/modules/pages/checkout_shipping/header_php.php:188]
#3 require(/home/chainwea/public_html/includes/modules/pages/checkout_shipping/header_php.php) called at [/home/chainwea/public_html/index.php:36]

[19-Aug-2014 12:08:29 America/Los_Angeles] PHP Warning: Illegal string offset 'ServiceName' in /home/chainwea/public_html/includes/modules/shipping/usps.php on line 440
[19-Aug-2014 12:08:29 America/Los_Angeles] #1 usps->quote() called at [/home/chainwea/public_html/includes/classes/shipping.php:140]
#2 shipping->quote() called at [/home/chainwea/public_html/includes/modules/pages/checkout_shipping/header_php.php:188]
#3 require(/home/chainwea/public_html/includes/modules/pages/checkout_shipping/header_php.php) called at [/home/chainwea/public_html/index.php:36]


and repeats for a total of 900 lines in the myDEBUG file

In a separate myDEBUG file:
[19-Aug-2014 12:08:09 America/Los_Angeles] #1 usps->quote() called at [/home/chainwea/public_html/includes/classes/shipping.php:140]
#2 shipping->quote() called at [/home/chainwea/public_html/includes/modules/shipping_estimator.php:140]
#3 require(/home/chainwea/public_html/includes/modules/shipping_estimator.php) called at [/home/chainwea/public_html/includes/templates/westminster_new/templates/tpl_shopping_cart_default.php:197]
#4 require(/home/chainwea/public_html/includes/templates/westminster_new/templates/tpl_shopping_cart_default.php) called at [/home/chainwea/public_html/includes/templates/westminster_new/common/tpl_main_page.php:253]
#5 require(/home/chainwea/public_html/includes/templates/westminster_new/common/tpl_main_page.php) called at [/home/chainwea/public_html/index.php:97]

[19-Aug-2014 12:08:09 America/Los_Angeles] PHP Warning: Illegal string offset 'ServiceName' in /home/chainwea/public_html/includes/modules/shipping/usps.php on line 437
[19-Aug-2014 12:08:09 America/Los_Angeles] #1 usps->quote() called at [/home/chainwea/public_html/includes/classes/shipping.php:140]
#2 shipping->quote() called at [/home/chainwea/public_html/includes/modules/shipping_estimator.php:140]
#3 require(/home/chainwea/public_html/includes/modules/shipping_estimator.php) called at [/home/chainwea/public_html/includes/templates/westminster_new/templates/tpl_shopping_cart_default.php:197]
#4 require(/home/chainwea/public_html/includes/templates/westminster_new/templates/tpl_shopping_cart_default.php) called at [/home/chainwea/public_html/includes/templates/westminster_new/common/tpl_main_page.php:253]
#5 require(/home/chainwea/public_html/includes/templates/westminster_new/common/tpl_main_page.php) called at [/home/chainwea/public_html/index.php:97]

repeated for a total of 1260 lines

& there are multiple instances of the same myDEBUG files
19 Aug 2014, 22:47
#2
mc12345678 avatar

mc12345678

Totally Zenned

Join Date:
Jul 2012
Posts:
16,907
Plugin Contributions:
1

Re: myDEBUG: USPS quote errors

RixStix:

Upgraded Aug 3 from v1.3.9H to v1.5.3

All has been functioning error free until Aug 17 when php was upgraded from 5.3.28 to 5.4.31. PHP settings is beyond my paygrade. DrByte said that php upgrade to any stable version should not cause any problems.

It's probably safe to assume that the error is php version related.



and repeats for a total of 900 lines in the myDEBUG file

In a separate myDEBUG file:

repeated for a total of 1260 lines

& there are multiple instances of the same myDEBUG files


Typical question(s), what version of usps is installed? I think the way typically to identify is to use admin-tools-developer's toolkit, lower left corner box, type in usps.php, then drop down of catalog/admin, then search.
19 Aug 2014, 22:51
#3
rixstix avatar

rixstix

Totally Zenned

Join Date:
Aug 2009
Posts:
2,015
Plugin Contributions:
0

Re: myDEBUG: USPS quote errors

USPS Version Date
2014-03-07
20 Aug 2014, 00:20
#4
ajeh avatar

ajeh

Oba-san

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

Re: myDEBUG: USPS quote errors

For the USPS issue with php 5.4.30+ (pretty sure that is the version is started with), make the following changes to the usps shipping module:
/includes/modules/shipping/usps.php

around line 397:
            if (isset($Package['SpecialServices']['SpecialService']['ServiceName']) && !isset($Package['SpecialServices']['SpecialService'][0])) {
//              $Package['SpecialServices']['SpecialService'][] = $Package['SpecialServices']['SpecialService'];
              $Package['SpecialServices']['SpecialService'] = array($Package['SpecialServices']['SpecialService']);
            }


and around line 434:
            if (isset($Package['ExtraServices']['ExtraService']['ServiceName']) && !isset($Package['ExtraServices']['ExtraService'][0])) {
//              $Package['ExtraServices']['ExtraService'][] = $Package['ExtraServices']['ExtraService'];
              $Package['ExtraServices']['ExtraService'] = array($Package['ExtraServices']['ExtraService']);
            }


See if that corrects the USPS issue ...

This "fix" would be compatible with all PHP 5.x versions.

Be sure to test both Domestic and International shipping ...
20 Aug 2014, 00:37
#5
rixstix avatar

rixstix

Totally Zenned

Join Date:
Aug 2009
Posts:
2,015
Plugin Contributions:
0

Re: myDEBUG: USPS quote errors

Thanks Linda,

Change made and we'll watch it for a bit. I'm not sure what triggers the myDEBUG.

Is this something new or did I miss a post or not search well enough for the answer?
20 Aug 2014, 00:40
#6
ajeh avatar

ajeh

Oba-san

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

Re: myDEBUG: USPS quote errors

Try doing a shipping estimate/checkout and see if they trigger any more ...
20 Aug 2014, 00:43
#7
ajeh avatar

ajeh

Oba-san

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

Re: myDEBUG: USPS quote errors

RixStix:

Thanks Linda,

Change made and we'll watch it for a bit. I'm not sure what triggers the myDEBUG.

Is this something new or did I miss a post or not search well enough for the answer?


This is kinda new and kinda not ...

I ran into it last month but had yet to hear anyone say anything about it so I have held off on the fix in light of the upcoming changes needed for September ...

Right now the usps test server is not working right and I do not have any time table on when the changes will be needed/required for users ...

Most users who will be caught out on these latest changes are those who use old versions of USPS and get away with it because of their shipping methods ...
20 Aug 2014, 01:23
#8
rixstix avatar

rixstix

Totally Zenned

Join Date:
Aug 2009
Posts:
2,015
Plugin Contributions:
0

Re: myDEBUG: USPS quote errors

That was interesting. Just as I clicked to get the shipping estimate

Bolt of lightning, instant crack of thunder, power goes off, comes back on in 4 seconds and the shipping estimate is on-screen (I luv my UPS).

Login as a customer, different zipcode, get shipping address, no thunder/lightning, checkout.

No myDEBUG logs generated.

Seems to be working just fine.

Thank you again.
20 Aug 2014, 02:38
#9
ajeh avatar

ajeh

Oba-san

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

Re: myDEBUG: USPS quote errors

Thanks for the update that this fix worked for you on the USPS March 7, 2014 K3 and php 5.4.30+ version ... :smile: