If this is your first visit, check our documentation. To post, register or login.
Forums / All Other Contributions/Addons / Language/Currency Links in Header

Language/Currency Links in Header

Started by bunyip on 1 Jun 2006, 7:44 AM · Views: 47,439

Results 61 to 80 of 121
13 Aug 2013, 7:32 PM
#61
athens_collectibles avatar

athens_collectibles

Zen Follower

Join Date:
May 2010
Location:
Athens, Greece
Posts:
293
Plugin Contributions:
0

Language/Currency Links in Header

Hi,

I don't know if it's officially marked as compatible but it works fine on my site after upgrading to 1.5.1

I hope this helps.

14 Aug 2013, 12:59 AM
#62
waterbender avatar

waterbender

New Zenner

Join Date:
May 2010
Posts:
84
Plugin Contributions:
0

Re: Language/Currency Links in Header

Thank you.

14 Aug 2013, 4:05 AM
#63
annie_zaz avatar

annie_zaz

Zen Follower

Join Date:
Mar 2013
Location:
Sydney, Australia
Posts:
140
Plugin Contributions:
0

Re: Language/Currency Links in Header

I installed this and I have one flag image (when clicked oni t does nothing) and the currency symbols are working as links. I would like to use the images of flags as links. I download the flag gifs by bunyip and then when I look at my zencart it has 5 flags and the currency symbols side by side. Should I keep the flag gifs as one image? or do I need to separate them? and how to make flags as links? what do I need to edit?
I have copied all files to correctly folders and successfully applied the sql instructions.
In admin>config>layout settings I can see the 2 new additions and they are set to true. I am running this on my local machine using xampp.
Any help would be appreciated.:huh:

15 Aug 2013, 5:03 AM
#64
annie_zaz avatar

annie_zaz

Zen Follower

Join Date:
Mar 2013
Location:
Sydney, Australia
Posts:
140
Plugin Contributions:
0

Re: Language/Currency Links in Header

I found the solution for adding flags as links instead of the currency symbol in another post THANKS TO RBARBOUR.
At present I have got it to display the flags and the links are working but its still displaying currency symbols also. I am still working on it.
However if you want to achieve this, look at the suggestion in the link below.

http://www.zen-cart.com/showthread.php?190878-Currency-flags-instead-of-dropdown-sidebox&highlight=currency+image+link+header

Basically go to your tpl_header_currencies and give the link an ID:

$content = "  ";
for ($i=0; $i<sizeof($currencies_array); $i++) {
$content .= '<a **id="navTopCurrencyId' **. $currencies_array[$i]['id'] . '"' . 'href="' . zen_href_link($_GET['main_page'], zen_get_all_get_params(array('language')) . 'currency=' . $currencies_array[$i]['id'], $request_type) . '">' . $currencies_array[$i]['text'] . '</a>  ';
}

echo $content;
?>

and then add in your css style sheet this css.
#navTopCurrencyIdUSD {
padding:0px 2px 7px 30px;
background-image: url(../images/USD.png);
background-repeat:no-repeat;
}
and repeat it for each flag.

3 Dec 2018, 6:54 PM
#65
twitchtoo avatar

twitchtoo

Totally Zenned

Join Date:
Apr 2007
Location:
Ontario, Canada
Posts:
1,733
Plugin Contributions:
14

Re: Language/Currency Links in Header

Finally, I've updated Language/Currency Links in Header for Zen Cart 1.55f including Mobile/Responsive Template files!

It should be available shortly in the forum and as always on my site.

How it works:

  • You can now display the language icons (flags) and currency symbols as links in the navigation section of your header.

  • Switch displays in the line below the Home/Log In/Shopping Cart header and by default floats to the right WITH the search header ON/OFF (desktop).

  • Loads below main logo on all mobile pages to prevent conflict with stock menu flyout (mobile).

  • In Admin > Configuration > Layout Settings - Turn Languages/Currencies ON/OFF

**
Key Features **

  • Installs into Template Default, Responsive_Classic and YOUR_TEMPLATE
  • Design notes included for easy updates - CSS styling
  • Compatible with text-icon swap for currency display
  • Code is split to display on mobile/responsive or desktop with separate CSS

**Install Into: **

  • Admin, Live Site

**Works With: **

  • All Twitch Modules

Note: This module is compatible with post #64:
https://www.zen-cart.com/showthread.php?37229-Language-Currency-Links-in-Header&p=1214534#post1214534

If my work has helped you today in any way, show your appreciation with things like positive feedback or** donations**.

Twitch.
https://www.twitchtoo.com Do you work for free? Please donate.
June 7.2026 - NOW AVAILABLE - Twitch Base8 - Obsidian

4 Dec 2018, 3:59 AM
#66
twitchtoo avatar

twitchtoo

Totally Zenned

Join Date:
Apr 2007
Location:
Ontario, Canada
Posts:
1,733
Plugin Contributions:
14

Re: Language/Currency Links in Header

For those wanting to add the currency 'code' or currency ID to the desktop header display...

Stock Display:
Language [Flag] $ € £ $ $

Add ID to Display:
**Language [Flag] USD $ EUR € GBP £ CAD $ AUD $

**includes/templates/YOUR_TEMPLATE/common/**tpl_header_currencies.php
**
replace line 13
$content .= '<a href="' . zen_href_link($_GET['main_page'], zen_get_all_get_params(array('language')) . 'currency=' . $currencies_array[$i]['id'], $request_type) . '">' . $currencies_array[$i]['text'] . '</a>  ';

with this:
$content .= '<a href="' . zen_href_link($_GET['main_page'], zen_get_all_get_params(array('language')) . 'currency=' . $currencies_array[$i]['id'], $request_type) . '">' . $currencies_array[$i]['id'] . ' ' . $currencies_array[$i]['text'] . '</a>   ';

Twitch.
https://www.twitchtoo.com Do you work for free? Please donate.
June 7.2026 - NOW AVAILABLE - Twitch Base8 - Obsidian

8 Dec 2018, 7:35 PM
#67
twitchtoo avatar

twitchtoo

Totally Zenned

Join Date:
Apr 2007
Location:
Ontario, Canada
Posts:
1,733
Plugin Contributions:
14

Re: Language/Currency Links in Header

cocteau:

Hello anyone note that this Language/Currency header disapper on all the Checkout pages?

Reminder in case this answer got lost...

The code is designed to be hidden during checkout by default to ensure the language and currency is maintained during the checkout before passing data to API's and the like...

includes/modules/YOUR_TEMPLATE/**header_currencies.php
**

// test if box should display
  $show_currencies= false;

  // don't display on checkout page:
  if (substr($current_page, 0, 8) != 'checkout') {
    $show_currencies= true;
  }

Twitch.
https://www.twitchtoo.com Do you work for free? Please donate.
June 7.2026 - NOW AVAILABLE - Twitch Base8 - Obsidian

9 Dec 2018, 8:18 PM
#68
twitchtoo avatar

twitchtoo

Totally Zenned

Join Date:
Apr 2007
Location:
Ontario, Canada
Posts:
1,733
Plugin Contributions:
14

Re: Language/Currency Links in Header

There now exists an add-on upgrade pack for this module:
**Twitch Add Sort Order Control to Language/Currency Links in Header
**
This module will install sort_order into your already installed 'Language/Currency Links in Header' module and allow use of the new sort field in Admin > Localization > Currencies

The default function of the stock header_currencies is to simply print out each value found in the currency array one at a time matched to the order found in the DB [currency ID]. This doesn't allow control of display unless the ID hard code is changed. So I added a sort_order column to ensure anything using the code, title or currency ID will NOT be affected sitewide. I have also limited the data manipulation using sort to the final - currency header display only.Because this module installs using** NULL** in the sort_order:

  • Admin will display alphabetically by **currency name **until there are sort orders to sort through
  • If the code can not resolve a sort conflict it will get screwy and follow the next logical output possible - likely title.

As an added feature:
The ***admin display sort order ***is **ALSO **the sort order used on the live site.

  • That means you will see immediately the order the site will display in admin each time you update the sort order.
  • This will help prevent duplicate sort order # problems also :)

This add on module is available on my site and I am in the process of merging it with the recent Language/Currency Links in Header v2.0 for v2.1 release shortly!

Twitch.
https://www.twitchtoo.com Do you work for free? Please donate.
June 7.2026 - NOW AVAILABLE - Twitch Base8 - Obsidian

7 Mar 2019, 12:49 AM
#69
mariemeh avatar

mariemeh

New Zenner

Join Date:
Mar 2019
Location:
Montreal
Posts:
39
Plugin Contributions:
0

Re: Language/Currency Links in Header

ZC Version 1.5.6a and I have very little modifications made to the stock files...

I got this to work on my site. Managed to have the currency ID show by changing in Localisation de Symbol to the Symbol and ID which in my case, helps. Now it shows as I want it on desktop and mobile but can't make it show on tablet. Am I doing something of when specified mobile below it is because it is mobile only? And if that is the case, can you offer some pointers on having it show on tablet?

thanks you

twitchtoo:

Finally, I've updated Language/Currency Links in Header for Zen Cart 1.55f including Mobile/Responsive Template files!

It should be available shortly in the forum and as always on my site.

How it works:

  • You can now display the language icons (flags) and currency symbols as links in the navigation section of your header.

  • Switch displays in the line below the Home/Log In/Shopping Cart header and by default floats to the right WITH the search header ON/OFF (desktop).

  • Loads below main logo on all mobile pages to prevent conflict with stock menu flyout (mobile).

  • In Admin > Configuration > Layout Settings - Turn Languages/Currencies ON/OFF

**
Key Features **

  • Installs into Template Default, Responsive_Classic and YOUR_TEMPLATE
  • Design notes included for easy updates - CSS styling
  • Compatible with text-icon swap for currency display
  • Code is split to display on mobile/responsive or desktop with separate CSS

**Install Into: **

  • Admin, Live Site

**Works With: **

  • All Twitch Modules

Note: This module is compatible with post #64:
https://www.zen-cart.com/showthread.php?37229-Language-Currency-Links-in-Header&p=1214534#post1214534

If my work has helped you today in any way, show your appreciation with things like positive feedback or** donations**.

7 Mar 2019, 1:03 AM
#70
mariemeh avatar

mariemeh

New Zenner

Join Date:
Mar 2019
Location:
Montreal
Posts:
39
Plugin Contributions:
0

Re: Language/Currency Links in Header

I found this code that calls to both mobile and tablet... and it works on mobile but it doesn't detect it on my tablet

<?php if ( $detect->isMobile() && !$detect->isTablet() || $_SESSION['layoutType'] == 'mobile' ) { ?> <!-- <div id="navMainSearch1" class="forward"><?php // require(DIR_WS_MODULES . 'sideboxes/search_header.php'); ?></div> -

mariemeh:

ZC Version 1.5.6a and I have very little modifications made to the stock files...

I got this to work on my site. Managed to have the currency ID show by changing in Localisation de Symbol to the Symbol and ID which in my case, helps. Now it shows as I want it on desktop and mobile but can't make it show on tablet. Am I doing something of when specified mobile below it is because it is mobile only? And if that is the case, can you offer some pointers on having it show on tablet?

thanks you

7 Mar 2019, 2:17 AM
#71
twitchtoo avatar

twitchtoo

Totally Zenned

Join Date:
Apr 2007
Location:
Ontario, Canada
Posts:
1,733
Plugin Contributions:
14

Re: Language/Currency Links in Header

mariemeh:

I found this code that calls to both mobile and tablet... and it works on mobile but it doesn't detect it on my tablet

What is the tablet make/model?

Twitch.
https://www.twitchtoo.com Do you work for free? Please donate.
June 7.2026 - NOW AVAILABLE - Twitch Base8 - Obsidian

7 Mar 2019, 3:03 AM
#72
mariemeh avatar

mariemeh

New Zenner

Join Date:
Mar 2019
Location:
Montreal
Posts:
39
Plugin Contributions:
0

Re: Language/Currency Links in Header

My apologies, I forgot to include that info

iPad 4th A1460

twitchtoo:

What is the tablet make/model?

12 Mar 2019, 2:55 AM
#73
mariemeh avatar

mariemeh

New Zenner

Join Date:
Mar 2019
Location:
Montreal
Posts:
39
Plugin Contributions:
0

Re: Language/Currency Links in Header

Figured it out. Just in case someone else needs this, the code you added underneatch mobile needs to be added as well under tablet and all is now working. I'm no pro so if there is something wrong with this, please feel free to say.

shop/includes/templates/responsive_classic/common/tpl_header.php

<!-- bof languages/currencies header display -->
<div id="navCurrenciesWrapperMobile" class="notforward clearBoth">
<?php 
  if (HEADER_LANGUAGES_DISPLAY == 'true') require(DIR_WS_MODULES . 'header_languages.php');
  if (HEADER_CURRENCIES_DISPLAY == 'true') require(DIR_WS_MODULES . 'header_currencies.php');
?>
</div>
<!-- eof  languages/currencies header display -->

<?php  } else if ( $detect->isTablet() || $_SESSION['layoutType'] == 'tablet' ) { ?>
  <!--   <div id="navMainSearch1" class="forward"><?php // require(DIR_WS_MODULES . 'sideboxes/search_header.php'); ?></div> -->

<!-- bof languages/currencies header display -->
<div id="navCurrenciesWrapperMobile" class="notforward clearBoth">
<?php 
  if (HEADER_LANGUAGES_DISPLAY == 'true') require(DIR_WS_MODULES . 'header_languages.php');
  if (HEADER_CURRENCIES_DISPLAY == 'true') require(DIR_WS_MODULES . 'header_currencies.php');
?>
</div>
<!-- eof  languages/currencies header display -->

twitchtoo:

What is the tablet make/model?

26 Nov 2019, 11:19 AM
#74
ingar avatar

ingar

New Zenner

Join Date:
Sep 2019
Location:
Ramat Gan, Israel
Posts:
31
Plugin Contributions:
0

Re: Language/Currency Links in Header

Hi guys, does anybody know how to implement switching language/currencies as a small drop-down menus with a simple text instead of flags. Would appreciate a hint where to find a simple script for that purpose...

9 Dec 2019, 3:04 AM
#75
twitchtoo avatar

twitchtoo

Totally Zenned

Join Date:
Apr 2007
Location:
Ontario, Canada
Posts:
1,733
Plugin Contributions:
14

Re: Language/Currency Links in Header

includes/templates/YOUR_TEMPLATE/common/tpl_header_languages.php and tpl_header_currencies.php build the output display.

You can use the zen dropdown function to convert to dropdowns, just hide/replace the image/link code for **$content .= **

Twitch.
https://www.twitchtoo.com Do you work for free? Please donate.
June 7.2026 - NOW AVAILABLE - Twitch Base8 - Obsidian

13 Dec 2019, 8:11 PM
#76
ingar avatar

ingar

New Zenner

Join Date:
Sep 2019
Location:
Ramat Gan, Israel
Posts:
31
Plugin Contributions:
0

Re: Language/Currency Links in Header

twitchtoo:

includes/templates/YOUR_TEMPLATE/common/tpl_header_languages.php and tpl_header_currencies.php build the output display.

You can use the zen dropdown function to convert to dropdowns, just hide/replace the image/link code for **$content .= **

From what I see in my case:
includes/templates/YOUR_TEMPLATE/common/tpl_header.php build the output.
I can't find the file tpl_header_languages.php

14 Dec 2019, 3:24 PM
#77
twitchtoo avatar

twitchtoo

Totally Zenned

Join Date:
Apr 2007
Location:
Ontario, Canada
Posts:
1,733
Plugin Contributions:
14

Re: Language/Currency Links in Header

Ingar:

From what I see in my case:
includes/templates/YOUR_TEMPLATE/common/tpl_header.php build the output.
I can't find the file tpl_header_languages.php

https://www.zen-cart.com/downloads.php?do=file&id=30

Have you installed the module into YOUR_TEMPLATE ?

Twitch.
https://www.twitchtoo.com Do you work for free? Please donate.
June 7.2026 - NOW AVAILABLE - Twitch Base8 - Obsidian

14 Dec 2019, 6:47 PM
#78
ingar avatar

ingar

New Zenner

Join Date:
Sep 2019
Location:
Ramat Gan, Israel
Posts:
31
Plugin Contributions:
0

Re: Language/Currency Links in Header

Have you installed the module into YOUR_TEMPLATE ?
Yea I considered responsive classic as mine and now I discovered the two mentioned files sitting in includes/templates/template_default/common/
Should I copy the tpl_header_languages.php into responsive_classic? Removing I guess everything after ```
$content .=

$content .= '<a href="' . zen_href_link($_GET['main_page'], zen_get_all_get_params(array('language', 'currency')) . 'language=' . $key, $request_type) . '">' . zen_image(DIR_WS_LANGUAGES .  $value['directory'] . '/images/' . $value['image'], $value['name'], '', '', 'align="absmiddle"') . '</a>  ';
15 Dec 2019, 10:50 AM
#79
twitchtoo avatar

twitchtoo

Totally Zenned

Join Date:
Apr 2007
Location:
Ontario, Canada
Posts:
1,733
Plugin Contributions:
14

Re: Language/Currency Links in Header

All of the template override files in the default folder can be copied into the override template folder YOUR_TEMPLATE or responsive_classic as you mentioned.

I would make the move, upload and test to see they are working before changing any of the code. That will preserve your default fileset and prevent breaking the rule of 'one change at a time'.

Twitch.
https://www.twitchtoo.com Do you work for free? Please donate.
June 7.2026 - NOW AVAILABLE - Twitch Base8 - Obsidian

20 Mar 2020, 12:01 AM
#80
tctc avatar

tctc

New Zenner

Join Date:
Feb 2020
Location:
Brisbane
Posts:
7
Plugin Contributions:
0

Re: Language/Currency Links in Header

Is there any way to change the order of the currency choices i.e. to have the AUD$ appear first instead of the USD$? Thanks.