I am often asked by users of the site as well as customers, those who use several different languages on their online store, how to make it possible to change the logo along with switching the language on the site, that is, when switching opencart from Russian into Ukrainian, which would change itself Site logo.
Everything is really very simple, there are certainly many different ways to do this, but I'll show you today how quickly and very simply to solve this problem.
And so to change the logo with the language in opencart, you just need to change a few lines in the fileΒ /catalog/controller/common/header.php
In the above file, we find:
1 2 3 4 5 |
if (is_file(DIR_IMAGE . $this->config->get('config_logo'))) { $data['logo'] = $server . 'image/' . $this->config->get('config_logo'); } else { $data['logo'] = ''; } |
And change to the following code:
1 2 3 4 5 |
if ($data['lang'] == 'ru') { $data['logo'] = $server . 'image/'.('ru/logo.png'); } else { $data['logo'] = $server . 'image/'.('uk/logo.png'); } |
After we go to the folder image and create there two folders ru and uk and fill in your logo for the Ukrainian version of the folder uk and for the Russian version of the folder ru respectively.
That's basically all you need to do, now you have the option to display the logo in opencart for the selected language on the site.
No Comment
You can post first response comment.