The above PHP error happens in PHP 8.1, and struggling to find a fix for this.
Code below, which is triggering the php uncaught error: Cannot access protected property shoppingCart::$content_type in
public static function handleMissingDeliveryEntries($order, $us_state_codes)
{
if ($_SESSION['cart']->content_type == 'virtual') return $order->billing;
if (isset($order->delivery) && $order->delivery !== false && $order->delivery['street_address'] != '') {
return $order->delivery;
}
return $order->billing;
}
}
Any ideas on how the above code can be re-done to overcome this php fatal error?