Quote Originally Posted by Jeff_Mash View Post
Cindy - My site runs on PHP 7.4, but I switched over to PHP 8.1 to test it out and iron out the bugs.

Can you help me resolve this error: --> PHP Warning: Attempt to read property "delivery" on null in includes/classes/OnePageCheckout.php on line 225.

I am running OPC 2.4.6.

I assume the error is a configuration thing on my end, since OPC 2.4.6. came out long after PHP 8.1 was in use.

The code snippet from that version is basically this:

global $order, $db;
$order_country = -1;
$order_country = $order->delivery['country_id'];
That class has change significantly between v2.4.6 and v2.5.1 (the current release). Try changing line 225 to read
PHP Code:
$order_country $order->delivery['country_id'] ?? false