Page 1 of 1

Order comment not saving in database

Posted: Tue Nov 29, 2022 8:36 pm
by westswamp
Hello!
I have problem with checkout comments. It's not saving in database.
Even if I save comment in order at admin side it's not saving to database.
Database oc_order field "comment" is still empty.
OC is fresh install. No additional extensions.

Re: Order comment not saving in database

Posted: Tue Nov 29, 2022 11:18 pm
by straightlight
westswamp wrote:
Tue Nov 29, 2022 8:36 pm
Hello!
I have problem with checkout comments. It's not saving in database.
Even if I save comment in order at admin side it's not saving to database.
Database oc_order field "comment" is still empty.
OC is fresh install. No additional extensions.
OC version. Server error logs.

Re: Order comment not saving in database

Posted: Tue Nov 29, 2022 11:50 pm
by westswamp
straightlight wrote:
Tue Nov 29, 2022 11:18 pm
westswamp wrote:
Tue Nov 29, 2022 8:36 pm
Hello!
I have problem with checkout comments. It's not saving in database.
Even if I save comment in order at admin side it's not saving to database.
Database oc_order field "comment" is still empty.
OC is fresh install. No additional extensions.
OC version. Server error logs.
OC latest 4.0.1.1
PHP 8.1
Server error logs: only this recurring

Code: Select all

PHP Unknown: strtolower(): Passing null to parameter #1 ($string) of type string is deprecated
File: /extension/opencart/admin/controller/dashboard/map.php
Line: 84

Re: Order comment not saving in database

Posted: Wed Nov 30, 2022 12:33 am
by straightlight
Interesting.

See by changing:

Code: Select all

$json[strtolower($result['iso_code_2'])] = [
into:

Code: Select all

$json[oc_strtolower($result['iso_code_2'])] = [
or by changing into:

Code: Select all

$json[$result['iso_code_2']] = [
if that would solve the issue.

Re: Order comment not saving in database

Posted: Wed Nov 30, 2022 4:14 am
by westswamp
straightlight wrote:
Wed Nov 30, 2022 12:33 am
Interesting.

See by changing:

Code: Select all

$json[strtolower($result['iso_code_2'])] = [
into:

Code: Select all

$json[oc_strtolower($result['iso_code_2'])] = [
or by changing into:

Code: Select all

$json[$result['iso_code_2']] = [
if that would solve the issue.

Code: Select all

$json[oc_strtolower($result['iso_code_2'])] = [

Code: Select all

Error:  Call to undefined function Opencart\Admin\Controller\Extension\Opencart\Dashboard\oc_strtolower()
File: extension/opencart/admin/controller/dashboard/map.php
Line: 84
_________________________________________________

Code: Select all

$json[$result['iso_code_2']] = [
No error in log at the moment.

Now I found out how I can save comment in order admin view. First I have to refresh shipping and payment, then write comment and confirm.
But this will not solve problem because customer entered comment not still saving in database.

Re: Order comment not saving in database

Posted: Wed Nov 30, 2022 4:19 am
by straightlight
westswamp wrote:
Wed Nov 30, 2022 4:14 am
straightlight wrote:
Wed Nov 30, 2022 12:33 am
Interesting.

See by changing:

Code: Select all

$json[strtolower($result['iso_code_2'])] = [
into:

Code: Select all

$json[oc_strtolower($result['iso_code_2'])] = [
or by changing into:

Code: Select all

$json[$result['iso_code_2']] = [
if that would solve the issue.

Code: Select all

$json[oc_strtolower($result['iso_code_2'])] = [

Code: Select all

Error:  Call to undefined function Opencart\Admin\Controller\Extension\Opencart\Dashboard\oc_strtolower()
File: extension/opencart/admin/controller/dashboard/map.php
Line: 84
_________________________________________________

Code: Select all

$json[$result['iso_code_2']] = [
No error in log at the moment.

Now I found out how I can save comment in order admin view. First I have to refresh shipping and payment, then write comment and confirm.
But this will not solve problem because customer entered comment not still saving in database.
See with the MB version, in a test environment, in regard with the oc_strtolower helper function if it solves the issue or, as per the above, by simply removing the strtolower function if it will solve the issue. As for the checkout comment, if this issue can be reproduced in the MB version, I would suggest to create an issue at the Github Opencart repository. Also, keep monitoring the error logs with the customer comment since this issue might be caused by one of your Event Triggers.