Post by ru-lefthanded » Wed Apr 27, 2022 12:49 am

Getting the following error when click on "My account" on the footer of our test site:

Parse error: syntax error, unexpected 'public' (T_PUBLIC) in /home/customer/www/ xxx /public_html/catalog/controller/account/account.php on line 104
- loooking at that file it appears to relate to public function country() but not sure what this means or how to fix!

As a side note, nothing is showing up in the error logs in system / maintenance

Have tried clearing both SASS & theme cache - but not resolved

Running 3.03.2 with default theme

However, if you go to order history & then log in that way, everything works fine! (but that's not really a solution from a end user point of view!)

Would appreciate some help on this please :) - thank you in advance

New member

Posts

Joined
Tue Sep 03, 2013 3:39 am

Post by straightlight » Wed Apr 27, 2022 1:09 am

Contact the extension developer to resolve this issue. This error message is caused by an installed extension.

Dedication and passion goes to those who are able to push and merge a project.

Regards,
Straightlight
Programmer / Opencart Tester


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

Post by ru-lefthanded » Wed Apr 27, 2022 1:21 am

I have numerous extensions running & no idea which one might have caused this issue!

New member

Posts

Joined
Tue Sep 03, 2013 3:39 am

Post by ru-lefthanded » Wed Apr 27, 2022 1:32 am

And that section in the php file appears unchanged from the original OC download (albeit possibly a few lines further down the page)

New member

Posts

Joined
Tue Sep 03, 2013 3:39 am

Post by sw!tch » Wed Apr 27, 2022 2:42 am

You can look for catalog/controller/account/account.php from the storage/modification directory and see if any modification exists to that file.

It may lead you to the extension or cause of the problem.

--

Full Stack Web Developer :: Send a PM for Custom Work.
Backup and learn how to recover before you make any changes!


Active Member

Posts

Joined
Sat Apr 28, 2012 2:32 pm

Post by paulfeakins » Wed Apr 27, 2022 5:34 pm

ru-lefthanded wrote:
Wed Apr 27, 2022 1:21 am
I have numerous extensions running & no idea which one might have caused this issue!
One way to fix this is to disable them one by one until the error disappears.

UK OpenCart Hosting | OpenCart Audits | OpenCart Support - please email info@antropy.co.uk


User avatar
Guru Member
Online

Posts

Joined
Mon Aug 22, 2011 11:01 pm
Location - London Gatwick, United Kingdom

Post by ru-lefthanded » Wed Apr 27, 2022 6:07 pm

sw!tch wrote:
Wed Apr 27, 2022 2:42 am
You can look for catalog/controller/account/account.php from the storage/modification directory and see if any modification exists to that file.

It may lead you to the extension or cause of the problem.

--
Thanks - there are mods in there for virtually every other aspect but not account itself!
Have removed the line in twig til I can get to the bottom of what's causing this

New member

Posts

Joined
Tue Sep 03, 2013 3:39 am

Post by ru-lefthanded » Wed Apr 27, 2022 6:08 pm

paulfeakins wrote:
Wed Apr 27, 2022 5:34 pm
ru-lefthanded wrote:
Wed Apr 27, 2022 1:21 am
I have numerous extensions running & no idea which one might have caused this issue!
One way to fix this is to disable them one by one until the error disappears.
Thanks Paul - going to be a long job!!!

New member

Posts

Joined
Tue Sep 03, 2013 3:39 am

Post by ADD Creative » Wed Apr 27, 2022 6:54 pm

ru-lefthanded wrote:
Wed Apr 27, 2022 1:32 am
And that section in the php file appears unchanged from the original OC download (albeit possibly a few lines further down the page)
From your path and line number, it doesn't look like a change by a OCMOD. More likely it is a change to that file before line 104. Compare the whole file against the original from a clean download.

www.add-creative.co.uk


Expert Member

Posts

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

Post by ru-lefthanded » Wed Apr 27, 2022 9:33 pm

ADD Creative wrote:
Wed Apr 27, 2022 6:54 pm
ru-lefthanded wrote:
Wed Apr 27, 2022 1:32 am
And that section in the php file appears unchanged from the original OC download (albeit possibly a few lines further down the page)
From your path and line number, it doesn't look like a change by a OCMOD. More likely it is a change to that file before line 104. Compare the whole file against the original from a clean download.

Only differences that I can see are found in this section (had to compare with 3.0.3.7 original php file as dont have my orig download to hand):

my file:
$this->load->model('account/customer');
if ($this->config->get('config_affiliate_enabled')) {
$data['display_affiliate'] = true;

$this->load->model('account/affiliate');

$affiliate_info = $this->model_account_affiliate->getAffiliate($this->customer->getId());

if (!$affiliate_info) {
$data['affiliate'] = $this->url->link('account/affiliate/add', 'language=' . $this->config->get('config_language'));
} else {
$data['affiliate'] = $this->url->link('account/affiliate/edit', 'language=' . $this->config->get('config_language'));
}

if ($affiliate_info) {
$data['tracking'] = $this->url->link('account/tracking', 'language=' . $this->config->get('config_language'));
} else {
$data['tracking'] = '';
}
} else {
$data['tracking'] = '';
$data['display_affiliate'] = false;


$data['column_left'] = $this->load->controller('common/column_left');
$data['column_right'] = $this->load->controller('common/column_right');
$data['content_top'] = $this->load->controller('common/content_top');
$data['content_bottom'] = $this->load->controller('common/content_bottom');
$data['footer'] = $this->load->controller('common/footer');
$data['header'] = $this->load->controller('common/header');

$this->response->setOutput($this->load->view('account/account', $data));
}


original:
$this->load->model('account/customer');

$affiliate_info = $this->model_account_customer->getAffiliate($this->customer->getId());

if (!$affiliate_info) {
$data['affiliate'] = $this->url->link('account/affiliate/add', '', true);
} else {
$data['affiliate'] = $this->url->link('account/affiliate/edit', '', true);
}

if ($affiliate_info) {
$data['tracking'] = $this->url->link('account/tracking', '', true);
} else {
$data['tracking'] = '';
}

$data['column_left'] = $this->load->controller('common/column_left');
$data['column_right'] = $this->load->controller('common/column_right');
$data['content_top'] = $this->load->controller('common/content_top');
$data['content_bottom'] = $this->load->controller('common/content_bottom');
$data['footer'] = $this->load->controller('common/footer');
$data['header'] = $this->load->controller('common/header');

$this->response->setOutput($this->load->view('account/account', $data));
}

New member

Posts

Joined
Tue Sep 03, 2013 3:39 am

Post by ADD Creative » Wed Apr 27, 2022 9:59 pm

Someone has modified that file. I looks like code from later unreleased versions.

At the very least it's missing a }. So try changing.

Code: Select all

$data['display_affiliate'] = false;
To.

Code: Select all

$data['display_affiliate'] = false;
}
Could be other things wrong.

www.add-creative.co.uk


Expert Member

Posts

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

Post by ru-lefthanded » Fri May 20, 2022 1:08 am

Thank you add-creative - worked like a dream :)
Solved :)

New member

Posts

Joined
Tue Sep 03, 2013 3:39 am

Post by straightlight » Fri May 20, 2022 4:23 am

Now that the issue has been solved, please add: [SOLVED] at the beginning of the subject line on your post.

Dedication and passion goes to those who are able to push and merge a project.

Regards,
Straightlight
Programmer / Opencart Tester


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

Post by ru-lefthanded » Fri May 20, 2022 3:54 pm

:)

New member

Posts

Joined
Tue Sep 03, 2013 3:39 am
Who is online

Users browsing this forum: No registered users and 92 guests