Page 1 of 1

Checkout Page shows "Syntax Error"

Posted: Sun May 26, 2024 4:56 pm
by mahirstudio
I suddenly noticed my opencart site shows error on checkout page

Code: Select all

Parse error: syntax error, unexpected end of file, expecting function (T_FUNCTION) or const (T_CONST) in /home3/waxbikhz/jsale_data/storage/modification/catalog/controller/checkout/checkout.php on line 157
Kindly help how can I sort it out. Thanks in advance.

Re: Checkout Page shows "Syntax Error"

Posted: Sun May 26, 2024 9:12 pm
by ADD Creative
It would be helpful to provide more information such as your OpenCart version. It could be caused by an extension. Try disabling your extensions one by one.

If it's a live site, you should not have display errors on anyway.

Re: Checkout Page shows "Syntax Error"

Posted: Mon May 27, 2024 3:49 pm
by mahirstudio
Version 3.0.3.8
Using just 4 third-party extensions the site was working fine. But suddenly started showing errors. Error Code shared in the main post. Kindly help.

Re: Checkout Page shows "Syntax Error"

Posted: Mon May 27, 2024 5:45 pm
by ADD Creative
That error is telling you that there is an error on line 157 of storage/modification/catalog/controller/checkout/checkout.php. Since that file has been modified by an extension, you need to work out which one.

Re: Checkout Page shows "Syntax Error"

Posted: Tue May 28, 2024 3:41 pm
by mahirstudio
Removed all extension still same issue.

Re: Checkout Page shows "Syntax Error"

Posted: Tue May 28, 2024 4:19 pm
by ADD Creative
Did you refresh the modifications after removing extensions?

Re: Checkout Page shows "Syntax Error"

Posted: Tue May 28, 2024 5:02 pm
by JNeuhoff
mahirstudio wrote:
Tue May 28, 2024 3:41 pm
Removed all extension still same issue.
If it is still the same error, then you haven't fully removed your extensions. In a standard OpenCart there is no need to modify the checkout.php file.

Re: Checkout Page shows "Syntax Error"

Posted: Wed May 29, 2024 2:21 pm
by mahirstudio
I checked the .php file at the specified path and found that a missing bracket was causing the issue. After adding the bracket, the file started working correctly. I'm not sure how the bracket was removed, but everything is functioning now. Thank you for your assistance and time.

Re: Checkout Page shows "Syntax Error"

Posted: Wed May 29, 2024 9:30 pm
by paulfeakins
mahirstudio wrote:
Wed May 29, 2024 2:21 pm
I checked the .php file at the specified path and found that a missing bracket was causing the issue. After adding the bracket, the file started working correctly. I'm not sure how the bracket was removed, but everything is functioning now.
Your system will break next time you install an extension or clear any caches. You need to find out what extension it was and tell the developer to fix it properly.