Post by tsvetko.krastev » Sat Oct 21, 2017 2:51 am

Hey guys! I know there are a lot of topics like this, but I believe mine is different.
I have edited the carousel.tpl file and made the default size of the carousel smaller and hard-coded a html div with a static image. I want to put a php "if-else" statement that changes the img according to the selected language. How can I detect the language used in the carousel.tpl file?
I saw how to do it for the header file, but the same method is not working for the carousel. Could anyone help?
I'm using OC 2.2.
Thanks!!

New member

Posts

Joined
Wed Mar 23, 2016 3:36 pm
Location - Sofia, Bulgaria

Post by yodapt » Sat Oct 21, 2017 3:29 am

You need to add this in catalog/controller/module/carousel.php after line 4 :

Code: Select all

$data['lang'] = $this->language->get('code');
Then you can use it in carousel.tpl like you saw in header.tpl

Opencart Developer - My Extension Showcase
Contact me at aeon.yoda@gmail.com


User avatar
Active Member

Posts

Joined
Fri Jun 17, 2011 6:39 pm


Post by tsvetko.krastev » Sat Oct 21, 2017 7:30 am

Exactly! That's it! :) Many thanks for the help mate!! :) Much appriciated! :) Cheers!

New member

Posts

Joined
Wed Mar 23, 2016 3:36 pm
Location - Sofia, Bulgaria
Who is online

Users browsing this forum: No registered users and 2 guests