Hi,
I want to change the way the currency and language switcher works in my layout.
Has somebody tried to arrange it that way, that you only see the flag-icons, and they are listed side by side on the header template?
Appreciate your help!
Just tried this now. It's amazingly easy to do
Open
/catalog/controller/common/header.php
after
put this code
Then in /catalog/view/theme/default/template/common/header.tpl find and delete this code
in it's place put
and its done
Open
/catalog/controller/common/header.php
after
Code: Select all
if (($this->request->server['REQUEST_METHOD'] == 'POST') && isset($this->request->post['language_code'])) {
$this->session->data['language'] = $this->request->post['language_code'];
if (isset($this->request->post['redirect'])) {
$this->redirect($this->request->post['redirect']);
} else {
$this->redirect(HTTP_SERVER . 'index.php?route=common/home');
}
}
Code: Select all
if (($this->request->server['REQUEST_METHOD'] == 'GET') && isset($this->request->get['language_code'])) {
$this->session->data['language'] = $this->request->get['language_code'];
if (isset($this->request->get['redirect'])) {
$this->redirect($this->request->get['redirect']);
} else {
$this->redirect(HTTP_SERVER . 'index.php?route=common/home');
}
}
Code: Select all
<form action="<?php echo str_replace('&', '&', $action); ?>" method="post" enctype="multipart/form-data" id="language_form">
<div class="switcher">
<?php foreach ($languages as $language) { ?>
<?php if ($language['code'] == $language_code) { ?>
<div class="selected"><a><img src="image/flags/<?php echo $language['image']; ?>" alt="<?php echo $language['name']; ?>" /> <?php echo $language['name']; ?></a></div>
<?php } ?>
<?php } ?>
<div class="option">
<?php foreach ($languages as $language) { ?>
<a onclick="$('input[name=\'language_code\']').attr('value', '<?php echo $language['code']; ?>'); $('#language_form').submit();"><img src="image/flags/<?php echo $language['image']; ?>" alt="<?php echo $language['name']; ?>" /> <?php echo $language['name']; ?></a>
<?php } ?>
</div>
</div>
<div>
<input type="hidden" name="language_code" value="" />
<input type="hidden" name="redirect" value="<?php echo $redirect; ?>" />
</div>
</form>
Code: Select all
<?php foreach($languages as $language) : ?>
<a href="<?php echo str_replace('&', '&', $action); ?>&redirect=<?php echo urlencode($redirect); ?>&language_code=<?php echo urlencode($language['code']); ?>"><img src="image/flags/<?php echo $language['image']; ?>" alt="<?php echo $language['name']; ?>" /></a>
<?php endforeach; ?>
When I click on a flag to switch the language I get this error:
Warning: Cannot modify header information - headers already sent by (output started at /catalog/model/catalog/category.php:25) in /system/engine/controller.php on line 27
Do you know what I need to do to get it working again?
Warning: Cannot modify header information - headers already sent by (output started at /catalog/model/catalog/category.php:25) in /system/engine/controller.php on line 27
Do you know what I need to do to get it working again?
Who is online
Users browsing this forum: No registered users and 28 guests