Post by rainerk74 » Tue Apr 18, 2023 1:51 am

I have been using OC 2.3.0.2 for our little webshop without major problems for a few years, but when my service provider in Norway upgraded to PHP 8.2 I had to upgrade to OC 3.0.3.8 and the 3.0.x.x Maintenance to get it to work with PHP 8.2. After much adjustments most of the webshop seems to be working fine, but when I confirms the order as the last step in a purchase, error messages appear depending on which payment method I've chosen. If I chose Paypal Express everything appears to be going fine (using sandbox mode). I put in credit card credentials and the purchase goes through, but when automatically returned to the webshop the following error appears on top of a white screen:

Unknown: preg_replace(): Passing null to parameter #3 ($subject) of type array|string is deprecated in /home/4/e/energy-and-light/www/system/engine/action.php on line 65

Warning: Cannot modify header information - headers already sent by (output started at /home/4/e/energy-and-light/www/catalog/controller/startup/error.php:34) in /home/4/e/energy-and-light/www/system/library/response.php on line 36

Code for "www/system/engine/action.php on line 65" is $class = 'Controller' . preg_replace('/[^a-zA-Z0-9]/', '', $this->route);

Code for "www/catalog/controller/startup/error.php:34" is if ($this->config->get('config_error_display')) {
echo '<b>' . $error . '</b>: ' . $message . ' in <b>' . $file . '</b> on line <b>' . $line . '</b>';


Code for "www/system/library/response.php on line 36" is public function redirect($url, $status = 302) {
header('Location: ' . str_replace(array('&amp;', "\n", "\r"), array('&', '', ''), $url), true, $status);
exit();


When I go to the order section in my webshop admin, the payment is registered as pending, with the reason for not carried out as "unilateral". Also the following error appears on top of the admin page:

Warning: A non-numeric value encountered in /home/4/e/energy-and-light/www/admin/controller/extension/payment/pp_express.php on line 477
Unknown: number_format(): Passing null to parameter #1 ($num) of type float is deprecated in /home/4/e/energy-and-light/www/admin/controller/extension/payment/pp_express.php on line 479


Code for "www/admin/controller/extension/payment/pp_express.php on line 477" is $data['capture_remaining'] = number_format($paypal_info['total'] - $captured, 2);


Code for "www/admin/controller/extension/payment/pp_express.php on line 479" is $refunded = number_format($this->model_extension_payment_pp_express->getRefundedTotal($paypal_info['paypal_order_id']), 2);

I also notice under "Payment" that the "Amount authorized" is printed 7800.00 while "Amount recieved" is printed 7,800.00 with a comma as a thousand separator, so I suspect maybe that has something to do with the errors.

In my Paypal Sandbox admin nothing happens and no payment is registered.

Thoughts or suggestions are much appreciated.

Best regards
Rainer

Newbie

Posts

Joined
Mon Mar 27, 2023 1:46 am

Post by IP_CAM » Tue Apr 18, 2023 2:26 am

You should have been looking around first, to mainly keep, what you used before, just to mention this. ;)
But you hopefully did not try to use any of the formerly used Extensions, because none of them will work with OC v.3.x
Good Luck !
https://github.com/condor2/Opencart_230x_PHP_8

My Github OC Site: https://github.com/IP-CAM
5'600 + FREE OC Extensions, on the World's largest private Github OC Repository Archive Site.


User avatar
Legendary Member

Posts

Joined
Tue Mar 04, 2014 1:37 am
Location - Switzerland

Post by ADD Creative » Tue Apr 18, 2023 9:01 am

The first error could be due to a missing file or something creating an action without a route.

Make sure you switch off error display in all 3 places it needs to be. This will at least stop it breaking the redirect.

For the admin errors, this bit of code needs reworking to be fully compatible with PHP 8.2.
https://github.com/opencart/opencart/bl ... #L473-L481

www.add-creative.co.uk


Guru Member

Posts

Joined
Sat Jan 14, 2012 1:02 am
Location - United Kingdom

Post by SohBH » Tue Apr 18, 2023 6:49 pm

Hi,
It appears that upgrade was not successful. There are errors in some of the files that will need to be addressed by updating the source code.

View all extensions | Request custom work | Pricing | Contact Me


User avatar
Active Member

Posts

Joined
Mon Nov 02, 2020 12:01 am
Location - Malaysia
Who is online

Users browsing this forum: No registered users and 1 guest