Zen Cart Logo
Forums / Bug Reports / undefined constant in usps module

undefined constant in usps module

Views: 1,662

Results 1 to 3 of 3
12 Aug 2019, 4:33 PM
#1
edadk avatar

edadk

Zen Follower

Join Date:
Nov 2008
Posts:
191
Plugin Contributions:
0

undefined constant in usps module

Not sure if this belongs here or in the shipping module section.

Running 1.56b, received this warning/error:

[12-Aug-2019 10:44:32 America/New_York] Request URI: /index.php?main_page=checkout_shipping, IP address: xxxx
#1  usps->quote() called at [/usr/www/users/xxx/includes/classes/shipping.php:169]
#2  shipping->quote() called at [/usr/www/users/xxx/includes/modules/pages/checkout_shipping/header_php.php:187]
#3  require(/usr/www/users/xxx/includes/modules/pages/checkout_shipping/header_php.php) called at [/usr/www/users/xxx/index.php:36]
--> PHP Warning: Use of undefined constant MODULE_SHIPPING_USPS_REGULATIONS - assumed 'MODULE_SHIPPING_USPS_REGULATIONS' (this will throw an Error in a future version of PHP) in /usr/www/users/xxx/includes/modules/shipping/usps.php on line 351.

thanks,
Ed

12 Aug 2019, 4:44 PM
#2
swguy avatar

swguy

Administrator

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

Re: undefined constant in usps module

Hopefully this will be properly fixed in the next version of the USPS module, but for now change includes/modules/shipping/usps.php line 351 from

    if (MODULE_SHIPPING_USPS_REGULATIONS == 'True') {

to

    if (defined('MODULE_SHIPPING_USPS_REGULATIONS') && MODULE_SHIPPING_USPS_REGULATIONS == 'True') {
12 Aug 2019, 4:56 PM
#3
edadk avatar

edadk

Zen Follower

Join Date:
Nov 2008
Posts:
191
Plugin Contributions:
0

Re: undefined constant in usps module

Thank you for the fast response. Fix applied.