Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OC 4.0.2.3 customer view order history error #13749

Open
Belleson opened this issue Feb 29, 2024 · 0 comments
Open

OC 4.0.2.3 customer view order history error #13749

Belleson opened this issue Feb 29, 2024 · 0 comments

Comments

@Belleson
Copy link

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:

  1. Create an order with payment method that uses JSON, e.g. Square
  2. After order is complete, go to My Account->Order History
  3. Click View button
  4. 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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant