A
A
AltaiR2017-03-12 15:36:42
PHP
AltaiR, 2017-03-12 15:36:42

What is causing this error in opencart?

Hi all. The task was to display the second (different from the main) logo in the footer. Everywhere in controllers, in language files, and in templates, I copied the fields where the logo occurs with the addition of the word _footer . And everything seems to be fine: I uploaded an image through the admin panel, and the image is displayed normally in the footer, but an error appeared at the very top of the site:

Notice: Undefined variable: server in /Users/AltaiR/CloudMail/WebServers/royalgraff/catalog/controller/common/footer.php on line 32

In this file I have the following code:
if (is_file(DIR_IMAGE . $this->config->get('config_footer_logo'))) {
  $data['logo_footer'] = $server . 'image/' . $this->config->get('config_footer_logo');
} else {
  $data['logo_footer'] = '';
}

He sees an error in the second line.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Arman, 2017-03-12
@AltaiR-05

The $server variable is not declared, or it is out of scope (outside which function), and the picture is shown, because the relative path, without specifying the server, was enough for the browser to find the picture

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question