You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
where json_decode returns null for non-JSON strings.
PHP Warning: Trying to access array offset on value of type null in public_html/oc/catalog/controller/account/order.php
What section does it affect?
Customer view order history from Account page
The error also exists for shipping_method
To Reproduce
Steps to reproduce the behavior:
Create an order with payment method that uses JSON, e.g. Square
After order is complete, go to My Account->Order History
Click View button
See Internal Server Error! There has been a problem loading the page you are looking for.
The same order shows successfully in Admin console with empty payment method field, no server error page
Expected behavior
View payment history
Screenshots / Screen recordings
Server environment (please complete the following information):
Linux
PHP version 8.1
cPanel Version | 116.0 (build 11)
Apache Version | 2.4.58
MySQL Version | 8.0.36
Architecture | x86_64
Operating System | linux
Shared IP Address | 45.79.178.199
Path to Sendmail | /usr/sbin/sendmail
Path to Perl | /usr/bin/perl
Perl Version | 5.26.3
Kernel Version | 4.18.0-477.21.1.lve.1.el8.x86_64
Additional context
I have no PHP experience, otherwise would post a PR
The text was updated successfully, but these errors were encountered:
What version of OpenCart are you reporting this for?
OC 4.0.2.3
Describe the bug
In catalog/model/account/order.php lines 81 and 97
‘payment_method’ => $order_query->row['payment_method'] ? json_decode($order_query->row['payment_method'], true) : '',
where json_decode returns null for non-JSON strings.
PHP Warning: Trying to access array offset on value of type null in public_html/oc/catalog/controller/account/order.php
What section does it affect?
Customer view order history from Account page
The error also exists for shipping_method
To Reproduce
Steps to reproduce the behavior:
The same order shows successfully in Admin console with empty payment method field, no server error page
Expected behavior
View payment history
Screenshots / Screen recordings
Server environment (please complete the following information):
cPanel Version | 116.0 (build 11)
Apache Version | 2.4.58
MySQL Version | 8.0.36
Architecture | x86_64
Operating System | linux
Shared IP Address | 45.79.178.199
Path to Sendmail | /usr/sbin/sendmail
Path to Perl | /usr/bin/perl
Perl Version | 5.26.3
Kernel Version | 4.18.0-477.21.1.lve.1.el8.x86_64
Additional context
I have no PHP experience, otherwise would post a PR
The text was updated successfully, but these errors were encountered: