Zen Cart Logo
Forums / Addon Shipping Modules / FedEx Module Version 1.5.4, PHP Warning and Deprecated error in logs

FedEx Module Version 1.5.4, PHP Warning and Deprecated error in logs

Views: 2,612

Results 1 to 4 of 4
12 Aug 2020, 5:33 PM
#1
mattie_c avatar

mattie_c

New Zenner

Join Date:
Sep 2006
Posts:
39
Plugin Contributions:
0

FedEx Module Version 1.5.4, PHP Warning and Deprecated error in logs

I am receiving PHP Warning and Deprecated error logs in a vanilla Zen Cart 1.5.7 installation (PHP Version: 7.3.20) with FedEx Web Services Shipping Version 1.5.4

[12-Aug-2020 17:10:26 UTC] Request URI: /zen-cart-v1.5.7/index.php?main_page=shopping_cart, IP address: 00.000.000.000
#1 fedexwebservices->build_request() called at [/public_html/zen-cart-v1.5.7/includes/modules/shipping/fedexwebservices.php:470]
#2 fedexwebservices->quote() called at [/public_html/zen-cart-v1.5.7/includes/classes/shipping.php:174]
#3 shipping->quote() called at [/public_html/zen-cart-v1.5.7/includes/modules/shipping_estimator.php:156]
#4 require(/public_html/zen-cart-v1.5.7/includes/modules/shipping_estimator.php) called at [/public_html/zen-cart-v1.5.7/includes/templates/responsive_classic/templates/tpl_shopping_cart_default.php:200]
#5 require(/public_html/zen-cart-v1.5.7/includes/templates/responsive_classic/templates/tpl_shopping_cart_default.php) called at [/public_html/zen-cart-v1.5.7/includes/templates/responsive_classic/common/tpl_main_page.php:177]
#6 require(/public_html/zen-cart-v1.5.7/includes/templates/responsive_classic/common/tpl_main_page.php) called at [/public_html/zen-cart-v1.5.7/index.php:94]
--> PHP Warning: Use of undefined constant MODULE_SHIPPING_BOXES_MANAGER_STATUS - assumed 'MODULE_SHIPPING_BOXES_MANAGER_STATUS' (this will throw an Error in a future version of PHP) in /public_html/zen-cart-v1.5.7/includes/modules/shipping/fedexwebservices.php on line 85.

[12-Aug-2020 17:10:26 UTC] Request URI: /zen-cart-v1.5.7/index.php?main_page=shopping_cart, IP address: 00.000.000.000
#1 fedexwebservices->build_request() called at [/public_html/zen-cart-v1.5.7/includes/modules/shipping/fedexwebservices.php:470]
#2 fedexwebservices->quote() called at [/public_html/zen-cart-v1.5.7/includes/classes/shipping.php:174]
#3 shipping->quote() called at [/public_html/zen-cart-v1.5.7/includes/modules/shipping_estimator.php:156]
#4 require(/public_html/zen-cart-v1.5.7/includes/modules/shipping_estimator.php) called at [/public_html/zen-cart-v1.5.7/includes/templates/responsive_classic/templates/tpl_shopping_cart_default.php:200]
#5 require(/public_html/zen-cart-v1.5.7/includes/templates/responsive_classic/templates/tpl_shopping_cart_default.php) called at [/public_html/zen-cart-v1.5.7/includes/templates/responsive_classic/common/tpl_main_page.php:177]
#6 require(/public_html/zen-cart-v1.5.7/includes/templates/responsive_classic/common/tpl_main_page.php) called at [/public_html/zen-cart-v1.5.7/index.php:94]
--> PHP Warning: Use of undefined constant MODULE_SHIPPING_BOXES_MANAGER_STATUS - assumed 'MODULE_SHIPPING_BOXES_MANAGER_STATUS' (this will throw an Error in a future version of PHP) in /public_html/zen-cart-v1.5.7/includes/modules/shipping/fedexwebservices.php on line 277.

and

[12-Aug-2020 17:10:26 UTC] Request URI: /zen-cart-v1.5.7/index.php?main_page=shopping_cart, IP address: 00.000.000.000
#1 include_once() called at [/public_html/zen-cart-v1.5.7/includes/classes/shipping.php:67]
#2 shipping->__construct() called at [/public_html/zen-cart-v1.5.7/includes/modules/shipping_estimator.php:153]
#3 require(/public_html/zen-cart-v1.5.7/includes/modules/shipping_estimator.php) called at [/public_html/zen-cart-v1.5.7/includes/templates/responsive_classic/templates/tpl_shopping_cart_default.php:200]
#4 require(/public_html/zen-cart-v1.5.7/includes/templates/responsive_classic/templates/tpl_shopping_cart_default.php) called at [/public_html/zen-cart-v1.5.7/includes/templates/responsive_classic/common/tpl_main_page.php:177]
#5 require(/public_html/zen-cart-v1.5.7/includes/templates/responsive_classic/common/tpl_main_page.php) called at [/public_html/zen-cart-v1.5.7/index.php:94]
--> PHP Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; fedexwebservices has a deprecated constructor in /public_html/zen-cart-v1.5.7/includes/modules/shipping/fedexwebservices.php on line 2.

Thanks for your time!

12 Aug 2020, 9:37 PM
#3
mattie_c avatar

mattie_c

New Zenner

Join Date:
Sep 2006
Posts:
39
Plugin Contributions:
0

Re: FedEx Module Version 1.5.4, PHP Warning and Deprecated error in logs

Thanks swguy!
I searched through the forum but didn't think of checking the docs page.

For anyone else that needs this fix, edit:
includes/modules/shipping/fedexwebservices.php

Change Line 6:
function fedexwebservices() {
to
function __construct()

Change Line 85:
if (MODULE_SHIPPING_BOXES_MANAGER_STATUS == 'true') {
to
if (defined('MODULE_SHIPPING_BOXES_MANAGER_STATUS') && MODULE_SHIPPING_BOXES_MANAGER_STATUS == 'true') {

Change Line 277:
if (MODULE_SHIPPING_BOXES_MANAGER_STATUS == 'true' && is_array($packed_boxes) && sizeof($packed_boxes) > 0) {
to
if (defined(‘MODULE_SHIPPING_BOXES_MANAGER_STATUS') && MODULE_SHIPPING_BOXES_MANAGER_STATUS == 'true' && is_array($packed_boxes) && sizeof($packed_boxes) > 0) {

12 Aug 2020, 10:58 PM
#4
swguy avatar

swguy

Administrator

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

Re: FedEx Module Version 1.5.4, PHP Warning and Deprecated error in logs

Mattie C:

Thanks swguy!
I searched through the forum but didn't think of checking the docs page.

You wouldn't have found it - I just created it! :)