lat9 / one_page_checkout

One-Page Checkout for Zen Carts v1.5.7a and later.
GNU General Public License v2.0
15 stars 11 forks source link

Disregard shipping modules/methods with no 'id' #425

Open lat9 opened 4 days ago

lat9 commented 4 days ago

... which result in PHP warning/deprecated logs:

[13-Nov-2024 10:14:26 Australia/Sydney] Request URI: /index.php?main_page=checkout_one, IP address: x.x.x.x, Language id 1
#0 /home/mysite/example.com/includes/classes/shipping.php(271): zen_debug_error_handler()
#1 /home/mysite/example.com/includes/modules/pages/checkout_one/header_php.php(265): shipping->cheapest()
#2 /home/mysite/example.com/index.php(35): require('/home/mysite...')
--> PHP Warning: Undefined array key "id" in /home/mysite/example.com/includes/classes/shipping.php on line 271.

[13-Nov-2024 10:14:26 Australia/Sydney] Request URI: /index.php?main_page=checkout_one, IP address: 1.158.204.171, Language id 1
#0 /home/mysite/example.com/includes/templates/template_default/templates/tpl_modules_checkout_one_shipping.php(27): zen_debug_error_handler()
#1 /home/mysite/example.com/includes/templates/bootstrap/templates/tpl_modules_opc_shipping_choices.php(47): require('/home/mysite...')
#2 /home/mysite/example.com/includes/templates/bootstrap/templates/tpl_checkout_one_default.php(69): require('/home/mysite...')
#3 /home/mysite/example.com/includes/templates/bootstrap/common/tpl_main_page.php(216): require('/home/mysite...')
#4 /home/mysite/example.com/index.php(94): require('/home/mysite...')
--> PHP Warning: Undefined array key "id" in /home/mysite/example.com/includes/templates/template_default/templates/tpl_modules_checkout_one_shipping.php on line 27.

[13-Nov-2024 10:14:26 Australia/Sydney] Request URI: /index.php?main_page=checkout_one, IP address: x.x.x.x, Language id 1
#0 [internal function]: zen_debug_error_handler()
#1 /home/mysite/example.com/includes/templates/template_default/templates/tpl_modules_checkout_one_shipping.php(46): str_replace()
#2 /home/mysite/example.com/includes/templates/bootstrap/templates/tpl_modules_opc_shipping_choices.php(47): require('/home/mysite...')
#3 /home/mysite/example.com/includes/templates/bootstrap/templates/tpl_checkout_one_default.php(69): require('/home/mysite...')
#4 /home/mysite/example.com/includes/templates/bootstrap/common/tpl_main_page.php(216): require('/home/mysite...')
#5 /home/mysite/example.com/index.php(94): require('/home/mysite...')
--> PHP Deprecated: str_replace(): Passing null to parameter #3 ($subject) of type array|string is deprecated in /home/mysite/example.com/includes/templates/template_default/templates/tpl_modules_checkout_one_shipping.php on line 46.
lat9 commented 4 days ago

Seeing similar logs on the checkout_one page:

[13-Nov-2024 10:32:43 Australia/Sydney] Request URI: /index.php?main_page=checkout_one, IP address: x.x.x.x, Language id 1
#0 /includes/modules/pages/checkout_one/header_php.php(235): zen_debug_error_handler()
#1 /index.php(35): require('/home/mysite...')
--> PHP Warning: Undefined array key "id" in /includes/modules/pages/checkout_one/header_php.php on line 235.

[13-Nov-2024 10:32:43 Australia/Sydney] Request URI: /index.php?main_page=checkout_one, IP address: x.x.x.x, Language id 1
#0 /includes/modules/pages/checkout_one/header_php.php(240): zen_debug_error_handler()
#1 /index.php(35): require('/home/mysite...')
--> PHP Warning: Undefined array key "id" in /includes/modules/pages/checkout_one/header_php.php on line 240.