If this is your first visit, check our documentation. To post, register or login.

fatal php error.

Started by mikecnz on 14 Aug 2024, 9:58 PM · Views: 1,855

Results 1 to 9 of 9
14 Aug 2024, 9:58 PM
#1
mikecnz avatar

mikecnz

New Zenner

Join Date:
Mar 2009
Location:
New Zealand
Posts:
76
Plugin Contributions:
0

Post #1 by mikecnz

Hi,

Running 2.0.1
Bootstrap
OPC

PHP 8 -our host doesnt offer 8.3 and the sight wont run at all on 8.1 or 8.2.

Getting a whitepage at checkout and this error…

PHP Fatal error: Uncaught TypeError: Unsupported operand types: float + string in /home/zcammell8139nz/public_html/includes/classes/order.php:758

14 Aug 2024, 11:06 PM
#2
mikecnz avatar

mikecnz

New Zenner

Join Date:
Mar 2009
Location:
New Zealand
Posts:
76
Plugin Contributions:
0

Post #2 by mikecnz

Strangely, I dont get this error on my localhost.

15 Aug 2024, 12:41 AM
#3
lat9 avatar

lat9

Administrator

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

Post #3 by lat9

When you're posting a debug-log, it's very important to post the full information (obfuscating any IP addresses and site-specific information). The backtrace that's included in the logs is what helps to figure out where the actual error came from.

15 Aug 2024, 1:51 AM
#4
mikecnz avatar

mikecnz

New Zenner

Join Date:
Mar 2009
Location:
New Zealand
Posts:
76
Plugin Contributions:
0

Post #4 by mikecnz

Apologies, below is the full log…
[15-Aug-2024 00:24:18 UTC] PHP Fatal error: Uncaught TypeError: Unsupported operand types: float + string in /home//public_html/includes/classes/order.php:758
Stack trace:
#0 /home/
/public_html/includes/classes/order.php(154): order->cart()
#1 /home//public_html/includes/modules/shipping_estimator.php(87): order->__construct()
#2 /home/
/public_html/includes/templates/bootstrapCammell/templates/tpl_shopping_cart_default.php(240): require('/home/...')
#3 /home/
/public_html/includes/templates/bootstrapCammell/common/tpl_main_page.php(227): require('/home/...')
#4 /home/
/public_html/index.php(94): require('/home/...')
#5 {main}
thrown in /home/
/public_html/includes/classes/order.php on line 758

[15-Aug-2024 00:24:18 UTC] Request URI: /index.php?main_page=shopping_cart, IP address: 101.100.145.79
--> PHP Fatal error: Uncaught TypeError: Unsupported operand types: float + string in /home//public_html/includes/classes/order.php:758
Stack trace:
#0 /home/
/public_html/includes/classes/order.php(154): order->cart()
#1 /home//public_html/includes/modules/shipping_estimator.php(87): order->__construct()
#2 /home/
/public_html/includes/templates/bootstrapCammell/templates/tpl_shopping_cart_default.php(240): require('/home/...')
#3 /home/
/public_html/includes/templates/bootstrapCammell/common/tpl_main_page.php(227): require('/home/...')
#4 /home/
/public_html/index.php(94): require('/home/...')
#5 {main}
thrown in /home/
/public_html/includes/classes/order.php on line 758.
[15-Aug-2024 00:24:18 UTC] Request URI: /index.php?main_page=shopping_cart, IP address: 101.100.145.79
--> PHP Fatal error: Uncaught TypeError: Unsupported operand types: float + string in /home//public_html/includes/classes/order.php:758
Stack trace:
#0 /home/
/public_html/includes/classes/order.php(154): order->cart()
#1 /home//public_html/includes/modules/shipping_estimator.php(87): order->__construct()
#2 /home/
/public_html/includes/templates/bootstrapCammell/templates/tpl_shopping_cart_default.php(240): require('/home/...')
#3 /home/
/public_html/includes/templates/bootstrapCammell/common/tpl_main_page.php(227): require('/home/...')
#4 /home/
/public_html/index.php(94): require('/home/...')
#5 {main}
thrown in /home/
/public_html/includes/classes/order.php on line 758

bootstrapcammell is a straight copy of bootstrap.

The only information i could find about a similar issue was here:

https://github.com/zencart/zencart/issues/4475

15 Aug 2024, 2:07 AM
#5
mikecnz avatar

mikecnz

New Zenner

Join Date:
Mar 2009
Location:
New Zealand
Posts:
76
Plugin Contributions:
0

Post #5 by mikecnz

As the issue appeared to be with the shipping estimator Idecided to turn it off. I then get the following error:

[15-Aug-2024 01:58:09 UTC] PHP Fatal error: Uncaught TypeError: Unsupported operand types: string * string in /home//public_html/includes/classes/currencies.php:101
Stack trace:
#0 /home/
/public_html/includes/classes/currencies.php(68): currencies->rateAdjusted()
#1 /home//public_html/includes/templates/bootstrapCammell/templates/tpl_checkout_shipping_default.php(116): currencies->format()
#2 /home/
/public_html/includes/templates/bootstrapCammell/common/tpl_main_page.php(227): require('/home/...')
#3 /home/
/public_html/index.php(94): require('/home/...')
#4 {main}
thrown in /home/
/public_html/includes/classes/currencies.php on line 101

[15-Aug-2024 01:58:09 UTC] Request URI: /index.php?main_page=checkout_shipping, IP address: 101.100.145.79
--> PHP Fatal error: Uncaught TypeError: Unsupported operand types: string * string in /home//public_html/includes/classes/currencies.php:101
Stack trace:
#0 /home/
/public_html/includes/classes/currencies.php(68): currencies->rateAdjusted()
#1 /home//public_html/includes/templates/bootstrapCammell/templates/tpl_checkout_shipping_default.php(116): currencies->format()
#2 /home/
/public_html/includes/templates/bootstrapCammell/common/tpl_main_page.php(227): require('/home/...')
#3 /home/
/public_html/index.php(94): require('/home/...')
#4 {main}
thrown in /home/
/public_html/includes/classes/currencies.php on line 101.

[15-Aug-2024 01:58:09 UTC] Request URI: /index.php?main_page=checkout_shipping, IP address: 101.100.145.79
--> PHP Fatal error: Uncaught TypeError: Unsupported operand types: string * string in /home//public_html/includes/classes/currencies.php:101
Stack trace:
#0 /home/
/public_html/includes/classes/currencies.php(68): currencies->rateAdjusted()
#1 /home//public_html/includes/templates/bootstrapCammell/templates/tpl_checkout_shipping_default.php(116): currencies->format()
#2 /home/
/public_html/includes/templates/bootstrapCammell/common/tpl_main_page.php(227): require('/home/...')
#3 /home/
/public_html/index.php(94): require('/home/...')
#4 {main}
thrown in /home/
/public_html/includes/classes/currencies.php on line 101

15 Aug 2024, 1:58 PM
#6
lat9 avatar

lat9

Administrator

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

Post #6 by lat9

For error#1, please add the highlighted to /includes/classes/order.php; the comment starts at line 756 of that file

        // Update the final total to include tax if not already tax-inc
        if (DISPLAY_PRICE_WITH_TAX == 'true') {
[B]trigger_error(var_export($this->info, true));[/B]
            $this->info['total'] = $this->info['subtotal'] + $this->info['shipping_cost'];
        } else {
            $this->info['total'] = $this->info['subtotal'] + $this->info['tax'] + $this->info['shipping_cost'];
        }

That'll create another myDEBUG log containing the order's information section, just prior to the error you reported. Please post that 'new' log for review.

P.S. What shipping, payment and order-total modules are in use?

15 Aug 2024, 8:47 PM
#7
mikecnz avatar

mikecnz

New Zenner

Join Date:
Mar 2009
Location:
New Zealand
Posts:
76
Plugin Contributions:
0

Post #7 by mikecnz

Hi,

Currently I have freeshipping options and store pick up (I've removed our custom freight module to see if that was causing problems).

No order-total modules are in use:

Attachment 20733

Should there be? I remember more options on my 1.5.7 cart.

Below is the output requested:

[15-Aug-2024 19:50:08 UTC] PHP Notice: array (
'order_status' => '1',
'currency' => 'NZD',
'currency_value' => '1.000000',
'payment_method' => '',
'payment_module_code' => '',
'coupon_code' => '',
'shipping_method' => '',
'shipping_module_code' => '',
'shipping_cost' => 0,
'tax_subtotals' =>
array (
'GST' =>
array (
'tax_rate' => 14.999999999999991,
'subtotal' => 12.900009999999998,
),
),
'subtotal' => 12.900009999999998,
'shipping_tax' => 0,
'shipping_tax_rate' => NULL,
'tax' => 1.6826099999999986,
'total' => 0,
'tax_groups' =>
array (
'GST' => 1.6826099999999986,
),
'comments' => '',

I've also turned off OPC, for the payment module I am using Paypals restful API.

15 Aug 2024, 8:48 PM
#8
mikecnz avatar

mikecnz

New Zenner

Join Date:
Mar 2009
Location:
New Zealand
Posts:
76
Plugin Contributions:
0

Post #8 by mikecnz

I'm thinking perhaps something has gone wrong with my migration from local to web?

15 Aug 2024, 9:45 PM
#9
lat9 avatar

lat9

Administrator

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

Post #9 by lat9

Yea, there's a PHP error being thrown by one of the order-total modules. That's why your list ends prematurely. You can post that as well.