is it possibile to change header image when user changes language?
e.g. header is.
when user clicks on spanish language, header image becomes another one with text in spanish (e.g comunidad)
I'm not sure if this would work without looking into it, but I beleive you can have HTML tags in the language definitions. So maybe you could create a new line in the header language files and then call upon it in the template in place of the normal code. If that makes sense? There's probably a better way.
WhiteBirch - Premium OpenCart Templates on ThemeForest
Skylight - Our first OpenCart 1.4.9.1 template!
Darkwood - Stylish new OpenCart 1.4.9.1 template!
you could use an if statment in the header to call another stylesheet.
something like
something like
Code: Select all
<?php if ($language['code'] == $language_code) { ?>
<link rel="stylesheet" type="text/css" href="catalog/view/theme/<?php echo $template; ?>/stylesheet/stylesheet.css" />
<!--[if lt IE 7]>
<link rel="stylesheet" type="text/css" href="catalog/view/theme/default/stylesheet/ie6.css" />
<?php } else { ?>
<link rel="stylesheet" type="text/css" href="catalog/view/theme/<?php echo $template; ?>/stylesheet/stylesheet2.css" />
<!--[if lt IE 7]>
<link rel="stylesheet" type="text/css" href="catalog/view/theme/default/stylesheet/ie6.css" />
<?php } ?>
I'm new to opencart but would a combination of javascript and php do the trick? Maybe something along the lines of:
Then all you need is an image for each language with the language code in the name in your theme file.
Code: Select all
document.getElementById('header').style.backgroundImage="url(path/to/backgroundimage<? $language['code']; ?>.jpg)"
Who is online
Users browsing this forum: No registered users and 20 guests