user3435616
user3435616

Reputation: 41

Change logo bassed on language in opencart 2

I am trying to make the main logo of the store change when I change language.
My company has a different name in English (originally in Hebrew).

Upvotes: 2

Views: 319

Answers (2)

Nipun Tyagi
Nipun Tyagi

Reputation: 898

As you are using OC 2.X then you can get the Language code in header.tpl file like this

$session = new Session();
$lang = $session->data['language'];
echo $lang // out put will be 'en' for enlgish

Then you can place condition to change the image URL, also you can place condition in header controller so controller will send the appropriate logo URL in $logo variable.

Upvotes: 2

shankar kumar
shankar kumar

Reputation: 648

$lang = $this->language->get('code'); 

use this line of code to check your language and then use if else to set your logo.

Upvotes: 1

Related Questions