Forums / Basic Configuration / Non-selected language header link

Non-selected language header link

Locked

Started by magicpants on 12 May 2006, 8:52 AM · Views: 2,984

Results 1 to 2 of 2
This thread is locked. New replies are disabled.
12 May 2006, 8:52 AM
#1
magicpants avatar

magicpants

Zen Follower

Join Date:
Aug 2005
Posts:
314
Plugin Contributions:
0

Non-selected language header link

I created a group of icons in the header to replace the text links in the header navigation, like 'login', 'contact us', etc. I want one of these icons to be for switching to the other language. I have it almost working (maybe?) -- it switches correctly from language 1 -> 2, but not the other way around. Here's what I have:

<?php echo '<div class="' . strtolower(HEADER_TITLE_LANGUAGE) . '"><a href="' . zen_href_link($_GET['main_page'], zen_get_all_get_params(array('language', 'currency')) . 'language=' . $key, $request_type) . '"></a></div>';?>

I know, I canibalized this code incorrectly but not sure what i'm missing. Any advice to get it fully functioning? I saw the threads on creating a language_header.php to put all of the language flags in the header. I only have two languages and want it to display JUST the one that is currently not selected.

Thanks in advance! Running 1.3.0.1 if it matters...

Currently using ZEN CART v. 1.3.6

12 May 2006, 9:52 AM
#2
magicpants avatar

magicpants

Zen Follower

Join Date:
Aug 2005
Posts:
314
Plugin Contributions:
0

Re: Non-selected language header link

Ok, I figured it out myself (maybe).

if ($_SESSION['languages_id'] == 1) {$key = 'da';}
	      else {$key = 'en';}
	      echo '<div class="' . strtolower(HEADER_TITLE_LANGUAGE) . '"><a href="' . zen_href_link($_GET['main_page'], zen_get_all_get_params(array('language', 'currency')) . 'language=' . $key, $request_type) . '"></a></div>';?>

It seemingly works now but I just guessed without knowing how this actually works. Can someone verify I'm not messing anything up with this?

Currently using ZEN CART v. 1.3.6