How to move language selector in OpenCart


How to move language selector in OpenCart



How to move language selector from "common.header" to anywhere else?



Once there are two or more languages on the website - a language selector begins to appear in the header section of the website, represented by {{ language }} twig variable.



If I cut


{{ language }}



from the template - language selector disappears. That is expected.



If I place it anywhere else outside common.header twig template - it doesn't appear.



It's not a css thing, the code just doesn't get parsed. I want to move it to footer but I can't seem to pinpoint the source of the problem.





Please read How to create a Minimal, Complete, and Verifiable example and edit your question accordingly.
– Chip
Jun 29 at 14:48





I read it and did what you said to the best of my abilities. It's just there isn't much code if any at all.
– Glenn Carver
Jun 29 at 22:46




1 Answer
1



If you want to show it in footer, edit this file:


catalogcontrollercommonfooter.php



Find:


return $this->load->view('common/footer', $data);



Add before it:


$data['language'] = $this->load->controller('common/language');



Now you can use it in footer.twig:


footer.twig


{{ language }}



You may need to clear modifications cache and theme caches.





Very well done. Thanks, that really works.
– Glenn Carver
Jun 29 at 22:33






By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Comments

Popular posts from this blog

paramiko-expect timeout is happening after executing the command

how to run turtle graphics in Colaboratory

Export result set on Dbeaver to CSV