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 81 to 100 of 121
20 Mar 2020, 12:04 AM
#81
dbltoe avatar

dbltoe

Totally Zenned

Join Date:
Jan 2004
Location:
N of San Antonio TX
Posts:
9,904
Plugin Contributions:
23

Language/Currency Links in Header

tctc:

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.
Which do you have listed as default?

Need a hand with Zen Cart? Hire the team at myZenCartZone.com for upgrades, repairs, and custom plugins.
Zen Cart Certified hosting at myZenCartHost.com

20 Mar 2020, 12:10 AM
#82
twitchtoo avatar

twitchtoo

Totally Zenned

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

Re: Language/Currency Links in Header

tctc:

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.

Admin > Localization > Currencies > select Currency, click Edit, add sort order to each currency listed.

Refresh the live site when you have finished to see the new sort order.

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

20 Mar 2020, 1:35 AM
#83
tctc avatar

tctc

New Zenner

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

Re: Language/Currency Links in Header

AUD as in Australia.

20 Mar 2020, 1:36 AM
#84
tctc avatar

tctc

New Zenner

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

Re: Language/Currency Links in Header

There is no way to change the sort order in 1.5.6 but I have AUD as default currency and that does not make any difference. Thanks.

20 Mar 2020, 1:46 AM
#85
tctc avatar

tctc

New Zenner

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

Re: Language/Currency Links in Header

There is not any option to do this?

20 Mar 2020, 1:46 AM
#86
twitchtoo avatar

twitchtoo

Totally Zenned

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

Re: Language/Currency Links in Header

tctc:

There is no way to change the sort order in 1.5.6 but I have AUD as default currency and that does not make any difference. Thanks.

The current module version has not been tested with 1.56c. All Twitch and public Zen modules are being re-written for 1.56c in funded priority at the moment :)

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

20 Mar 2020, 2:08 AM
#87
tctc avatar

tctc

New Zenner

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

Re: Language/Currency Links in Header

Thanks! :)

21 Dec 2020, 9:05 PM
#88
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 is a new version of this module available for 1.56c with minor bugs fixed and some new features to make it easier to use/install. I'll be packing it up shortly for public release!

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

30 Mar 2021, 12:36 PM
#89
philibel avatar

philibel

Zen Follower

Join Date:
Mar 2008
Location:
Belgium
Posts:
120
Plugin Contributions:
3

Re: Language/Currency Links in Header

I downloaded this plugin and wanted to use it for v1.5.7c on a php 7.4.16 site.

Originally the plugin is for v1.5.5 so I compared the original templates with the plugin templates and adjusted them for v1.5.7c

This will work only if your site php is lower than php 7.2

Because each() function is deprecated in php 7.2 you'll get a lot of error logs.
A search in the forum didn't give me any solution but Google found one that I could work out further:

If your site is php 7.2 or higher than find all instances of "each" like:

\includes\modules\header_currencies.php

Replace

<?php
      while (list($key, $value) = each($currencies->currencies)) { 

By

<?php
	foreach($currencies->currencies as $key => $value) { 

Replace

<?php
      while (list($key, $value) = each($_GET)) { 

By

<?php
      foreach($_GET as $key => $value) { 

**\includes\templates\template_default\common\tpl_header_languages.php
**
Replace

<?php
  while (list($key, $value) = each($lng->catalog_languages)) { 

By

<?php
	  foreach ($lng->catalog_languages as $key => $value) { 

Changes in ALL_TEMPLATES\common\tpl_header.php for v1.5.7c are more extensive and include a change so it will fit for multi-lingual shops that have customers in whose language the word "language" isn't "language". This word is hard-coded in the file.

3 Apr 2021, 10:57 AM
#90
philibel avatar

philibel

Zen Follower

Join Date:
Mar 2008
Location:
Belgium
Posts:
120
Plugin Contributions:
3

Re: Language/Currency Links in Header

Philibel:

Changes in ALL_TEMPLATES\common\tpl_header.php for v1.5.7c are more extensive and include a change so it will fit for multi-lingual shops that have customers in whose language the word "language" isn't "language". This word is hard-coded in the file.

My adaptation of the plugin works fine for me and as a member of the community of ZenCart users, I thought it would only be fair to share it with others users. So I submitted my version of this plugin which I tested and use for Zen Cart v1.5.7c on a php 7.4.16 site.

I has been approved and is available for download **Language/Currency Links in Header version v3.0**

7 Jan 2023, 7:31 PM
#91
nwce avatar

nwce

Zen Follower

Join Date:
Oct 2009
Posts:
444
Plugin Contributions:
0

Re: Language/Currency Links in Header

Hi,

I am installing this addon into a fresh v.1.5.8 test site. I have uploaded all files and when running the SQLpatch from Admin, I get a white screen error and this in my Error Logs....

#1 trigger_error() called at [C:\wamp64\www\158\includes\classes\db\mysql\query_factory.php:667]
#2 queryFactory->show_error() called at [C:\wamp64\www\158\includes\classes\db\mysql\query_factory.php:634]
#3 queryFactory->set_error() called at [C:\wamp64\www\158\includes\classes\db\mysql\query_factory.php:275]
#4 queryFactory->Execute() called at [C:\wamp64\www\158\ADMIN\sqlpatch.php:297]
#5 executeSql() called at [C:\wamp64\www\158\ADMIN\sqlpatch.php:744]
#6 require(C:\wamp64\www\158\ADMIN\sqlpatch.php) called at [C:\wamp64\www\158\ADMIN\index.php:11]
--> PHP Fatal error: 1366:Incorrect integer value: '' for column 'configuration_id' at row 1 :: INSERT INTO configuration (configuration_id, configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, last_modified, date_added, use_function, set_function) VALUES ('', 'Show Languages in Header?', 'HEADER_LANGUAGES_DISPLAY', 'true', 'Display the Languages flags/links in Header?', 19, 170, NULL, now(), NULL, 'zen_cfg_select_option(array(''true'', ''false''), '); ==> (as called by) C:\wamp64\www\158\ADMIN\sqlpatch.php on line 297 <== in C:\wamp64\www\158\includes\classes\db\mysql\query_factory.php on line 667.

Can you point me the right direction to correct this to finish the install of this mod??

Thank you for your help,

Jeff

7 Jan 2023, 8:55 PM
#92
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,142
Plugin Contributions:
56

Re: Language/Currency Links in Header

NWCE:

Hi,

I am installing this addon into a fresh v.1.5.8 test site. I have uploaded all files and when running the SQLpatch from Admin, I get a white screen error and this in my Error Logs....

#1 trigger_error() called at [C:\wamp64\www\158\includes\classes\db\mysql\query_factory.php:667]
#2 queryFactory->show_error() called at [C:\wamp64\www\158\includes\classes\db\mysql\query_factory.php:634]
#3 queryFactory->set_error() called at [C:\wamp64\www\158\includes\classes\db\mysql\query_factory.php:275]
#4 queryFactory->Execute() called at [C:\wamp64\www\158\ADMIN\sqlpatch.php:297]
#5 executeSql() called at [C:\wamp64\www\158\ADMIN\sqlpatch.php:744]
#6 require(C:\wamp64\www\158\ADMIN\sqlpatch.php) called at [C:\wamp64\www\158\ADMIN\index.php:11]
--> PHP Fatal error: 1366:Incorrect integer value: '' for column 'configuration_id' at row 1 :: INSERT INTO configuration (configuration_id, configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, last_modified, date_added, use_function, set_function) VALUES ('', 'Show Languages in Header?', 'HEADER_LANGUAGES_DISPLAY', 'true', 'Display the Languages flags/links in Header?', 19, 170, NULL, now(), NULL, 'zen_cfg_select_option(array(''true'', ''false''), '); ==> (as called by) C:\wamp64\www\158\ADMIN\sqlpatch.php on line 297 <== in C:\wamp64\www\158\includes\classes\db\mysql\query_factory.php on line 667.

Can you point me the right direction to correct this to finish the install of this mod??

Thank you for your help,

Jeff
Change that SQL patch from

 INSERT INTO configuration (configuration_id, configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, last_modified, date_added, use_function, set_function) VALUES ('', 'Show Languages in Header?', 'HEADER_LANGUAGES_DISPLAY', 'true', 'Display the Languages flags/links in Header?', 19, 170, NULL, now(), NULL, 'zen_cfg_select_option(array(''true'', ''false''), ');

to

 INSERT INTO configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, last_modified, date_added, use_function, set_function) VALUES ('Show Languages in Header?', 'HEADER_LANGUAGES_DISPLAY', 'true', 'Display the Languages flags/links in Header?', 19, 170, NULL, now(), NULL, 'zen_cfg_select_option(array(''true'', ''false''), ');

... essentially removing that configuration_id value that's invalid (the SQL processing will automatically calculate the next available value).

7 Jan 2023, 9:38 PM
#93
nwce avatar

nwce

Zen Follower

Join Date:
Oct 2009
Posts:
444
Plugin Contributions:
0

Re: Language/Currency Links in Header

Thanks very much for your help with this lat 9....this worked perfectly!!

Appreciate it,

Jeff

5 Mar 2023, 2:52 AM
#94
pilou2 avatar

pilou2

Zen Follower

Join Date:
Jun 2008
Location:
Japan
Posts:
416
Plugin Contributions:
6

Re: Language/Currency Links in Header

Hello,
I made a release of this module for Zen Cart v1.5.8. I removed css file which was not doing as expected and I prefer a thin bar at the top (styles make it thicker). Language flag for the actually used language is not displayed any more, only other available languages flags are, Same thing with currencies.
It works well but I made a mistake in the release with sql queries for install/uninstall. I stupidly did copy these queries from old version when making new release file. They must be corrected as stated above by lat9.
Remove configuration_id, and ```
'',

This small plugin is really a 'plus' in any multilingual Zen Cart, you should try it.

ZC v2.2.2 PHP 8.4+ MySQL 8.4+

24 May 2023, 1:18 PM
#95
pilou2 avatar

pilou2

Zen Follower

Join Date:
Jun 2008
Location:
Japan
Posts:
416
Plugin Contributions:
6

Re: Language/Currency Links in Header

I have just submitted a version4.0.2 in plugin section that add a file for template Bootstrap which structure is quite different than standard templates.

ZC v2.2.2 PHP 8.4+ MySQL 8.4+

26 Oct 2023, 6:00 PM
#96
jeff_mash avatar

jeff_mash

Totally Zenned

Join Date:
Aug 2004
Posts:
745
Plugin Contributions:
0

Re: Language/Currency Links in Header

Perhaps I'm doing something wrong, but I tried the latest on a test Bootstrap site, and there's nothing being displayed in the header.

It looks like the code is there, but no output is displayed because it's nothing but white-space.

I am attaching two screenshots. The first shows that nothing is displayed (I highlighted it with a blue box). The second shows the page source where you can see the output block is there but only white-space is noted where the content should be.

Attachment 20411
Attachment 20412

Any ideas why that's happening?

  • Jeff
27 Oct 2023, 2:26 AM
#97
pilou2 avatar

pilou2

Zen Follower

Join Date:
Jun 2008
Location:
Japan
Posts:
416
Plugin Contributions:
6

Re: Language/Currency Links in Header

Jeff_Mash:

Perhaps I'm doing something wrong, but I tried the latest on a test Bootstrap site, and there's nothing being displayed in the header.

It looks like the code is there, but no output is displayed because it's nothing but white-space.

I am attaching two screenshots. The first shows that nothing is displayed (I highlighted it with a blue box). The second shows the page source where you can see the output block is there but only white-space is noted where the content should be.

Attachment 20411
Attachment 20412

Any ideas why that's happening?

Just to check, you need at least two languages/currencies installed for this to work. Actually used language/currency is not displayed.
It looks like something is missing. Did you installed files in template_default, they are necessary.

The only problem I found that still need to be fixed is color diplay for currencies. Default is blue (link) and does not go well with dark background.

ZC v2.2.2 PHP 8.4+ MySQL 8.4+

27 Oct 2023, 9:42 PM
#98
jeff_mash avatar

jeff_mash

Totally Zenned

Join Date:
Aug 2004
Posts:
745
Plugin Contributions:
0

Re: Language/Currency Links in Header

Okay, thanks for the clarification. I was under the assumption that the plugin itself would offer a dropdown list of translations and currencies. I wasn't aware that it relied on what already preexisted from the store. Now it makes sense why nothing was displayed, because we currently only have one currency (USD) and one language file (English).

  • Jeff
28 Oct 2023, 5:36 AM
#99
pilou2 avatar

pilou2

Zen Follower

Join Date:
Jun 2008
Location:
Japan
Posts:
416
Plugin Contributions:
6

Re: Language/Currency Links in Header

I have just submitted version 4.0.3 in plugin section:
https://www.zen-cart.com/downloads.php?do=file&id=30
It will now display currencies links in Bootstrap template in a visible color and you can easily customize this by modifying css file.
Instruction/descrition have been updated too.

ZC v2.2.2 PHP 8.4+ MySQL 8.4+

9 Nov 2023, 11:33 PM
#100
zamzom avatar

zamzom

New Zenner

Join Date:
Jun 2009
Location:
Europe
Posts:
60
Plugin Contributions:
0

Re: Language/Currency Links in Header

Great work thanks.
Is is possible to make the currencies appear in a pull-down menu?
How to do this?