Post by mastplas » Tue Feb 11, 2020 6:02 am

Hi
Beginning to pull my hair out trying to resolve this issue.
I am getting this error

Parse error: syntax error, unexpected 'if' (T_IF), expecting function (T_FUNCTION) or const (T_CONST) in /home/xxx/xxx_storage/modification/catalog/controller/common/footer.php on line 52

I am running Journal 3 on OC v3.0.3.2

All was going well, but not now ... any help or suggestions would be appreciated

Code: Select all

<?php
class ControllerCommonFooter extends Controller {
	public function index() {

            if (defined('JOURNAL3_ACTIVE') && !$this->journal3->document->isPopup()) {
                $this->journal3->settings->set('desktop_main_menu', $this->load->controller('journal3/main_menu', array('module_type' => 'main_menu', 'module_id' => $this->journal3->settings->get('headerMainMenu'), 'id' => 'main-menu')));
                $this->journal3->settings->set('desktop_main_menu_2', $this->load->controller('journal3/main_menu', array('module_type' => 'main_menu', 'module_id' => $this->journal3->settings->get('headerMainMenu2'), 'id' => 'main-menu-2')));
                $this->journal3->settings->set('desktop_top_menu', $this->load->controller('journal3/top_menu', array('module_type' => 'top_menu', 'module_id' => $this->journal3->settings->get('headerTopMenu'))));
                $this->journal3->settings->set('desktop_top_menu_2', $this->load->controller('journal3/top_menu', array('module_type' => 'top_menu', 'module_id' => $this->journal3->settings->get('headerTopMenu2'))));
                $this->journal3->settings->set('desktop_top_menu_3', $this->load->controller('journal3/top_menu', array('module_type' => 'top_menu', 'module_id' => $this->journal3->settings->get('headerTopMenu3'))));

                if ($this->journal3->document->hasClass('mobile-header-active')) {
                    $this->journal3->settings->set('mobile_main_menu', $this->load->controller('journal3/main_menu', array('module_type' => 'main_menu', 'module_id' => $this->journal3->settings->get('headerMobileMainMenu'))));
                    $this->journal3->settings->set('mobile_top_menu', $this->load->controller('journal3/top_menu', array('module_type' => 'top_menu', 'module_id' => $this->journal3->settings->get('headerMobileTopMenu'))));
                }

                $data['footer_menu'] = $this->load->controller('journal3/footer_menu', array('module_type' => 'footer_menu', 'module_id' => $this->journal3->settings->get('footerMenu')));
            }
            
		$this->load->language('common/footer');

		$this->load->model('catalog/information');

		$data['informations'] = array();

		foreach (defined('JOURNAL3_ACTIVE') ? array() : $this->model_catalog_information->getInformations() as $result) {
			if ($result['bottom']) {
				$data['informations'][] = array(
					'title' => $result['title'],
					'href'  => $this->url->link('information/information', 'information_id=' . $result['information_id'])
				);
			}
		}

		$data['contact'] = $this->url->link('information/contact');
		$data['return'] = $this->url->link('account/return/add', '', true);
		$data['sitemap'] = $this->url->link('information/sitemap');
		$data['tracking'] = $this->url->link('information/tracking');
		$data['manufacturer'] = $this->url->link('product/manufacturer');
		$data['voucher'] = $this->url->link('account/voucher', '', true);
		$data['affiliate'] = $this->url->link('affiliate/login', '', true);
		$data['special'] = $this->url->link('product/special');
		$data['account'] = $this->url->link('account/account', '', true);
		$data['order'] = $this->url->link('account/order', '', true);
		$data['wishlist'] = $this->url->link('account/wishlist', '', true);
		$data['newsletter'] = $this->url->link('account/newsletter', '', true);

		$data['powered'] = sprintf($this->language->get('text_powered'), $this->config->get('config_name'), date('Y', time()));

		}
		// Whos Online
		if ($this->config->get('config_customer_online')) {
			$this->load->model('tool/online');

			if (isset($this->request->server['REMOTE_ADDR'])) {
				$ip = $this->request->server['REMOTE_ADDR'];
			} else {
				$ip = '';
			}

			if (isset($this->request->server['HTTP_HOST']) && isset($this->request->server['REQUEST_URI'])) {
				$url = ($this->request->server['HTTPS'] ? 'https://' : 'http://') . $this->request->server['HTTP_HOST'] . $this->request->server['REQUEST_URI'];
			} else {
				$url = '';
			}

			if (isset($this->request->server['HTTP_REFERER'])) {
				$referer = $this->request->server['HTTP_REFERER'];
			} else {
				$referer = '';
			}

			$this->model_tool_online->addOnline($ip, $this->customer->getId(), $url, $referer);
		}

		$data['scripts'] = $this->document->getScripts('footer');

		return $this->load->view('common/footer', $data);
	}
}
Last edited by straightlight on Tue Feb 11, 2020 7:13 am, edited 1 time in total.

Newbie

Posts

Joined
Fri Oct 17, 2014 2:12 am

Post by straightlight » Tue Feb 11, 2020 7:15 am

Replace:

Code: Select all

}
		// Whos Online
with:

Code: Select all

		// Whos Online
This should resolved the issue.

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 sw!tch » Tue Feb 11, 2020 7:19 am

Look for any modification that was done to the footer and try disabling that.

Keep in mind that even if you fix using the aforementioned code, if the modification is incorrect then when you refresh your modification the error will just come back. You may need to fix the modification causing the issue or disable it.

Backup and learn how to recover before you make any changes!


Active Member

Posts

Joined
Sat Apr 28, 2012 2:32 pm

Post by mastplas » Tue Feb 11, 2020 8:40 am

thank you

straightlight } was the offending character

Switch you were right, refreshing mods causes the error again, i will contact the developer

Thank you both for your time

Newbie

Posts

Joined
Fri Oct 17, 2014 2:12 am
Who is online

Users browsing this forum: No registered users and 5 guests