[Skip to main content](#vessel-content)

#   default currency depending on language

##

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png?1793428657)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Offline](/forum/user/63-nicolas)

Less More

- Posts: 86556
- Thank you received: 14305
-
-

14 years 2 months ago [\#62168](#62168) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Re: default currency depending on language](/forum/4-how-to/8776-default-currency-depending-on-language?start=20#62168 "Hi,  I am using Hikashop Essential so I have no option of using the geolocation plugin for this issue.  It would be very useful for me to change the displayed (default) currency according to the joomfish language the user switched to on my page. e.g. If the user switches to czech language, the prices are shown in czech crowns. In addition I will display the currency switcher module for languages that are not associated with only one currency (e.g. english).  Is there a possibility to &quot;link&quot; the language and the currency?  Thanx in advance")*

It's in the modules folder.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzg3NzYtZGVmYXVsdC1jdXJyZW5jeS1kZXBlbmRpbmctb24tbGFuZ3VhZ2U/c3RhcnQ9MjAmdG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[Stéphane Corbé](/forum/user/12579-stephane-corbe "View Stéphane Corbé's Profile")**
- [![Stéphane Corbé's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/12579-stephane-corbe "View Stéphane Corbé's Profile")
- [ Offline](/forum/user/12579-stephane-corbe)

Less More

- Posts: 3
- Thank you received: 1
-
-

13 years 10 months ago -  13 years 10 months ago [\#83663](#83663) by [Stéphane Corbé](/forum/user/12579-stephane-corbe "View Stéphane Corbé's Profile")  Replied by *[Stéphane Corbé](/forum/user/12579-stephane-corbe "View Stéphane Corbé's Profile")* on topic *[default currency depending on language](/forum/4-how-to/8776-default-currency-depending-on-language?start=20#83663 "Hi,  I am using Hikashop Essential so I have no option of using the geolocation plugin for this issue.  It would be very useful for me to change the displayed (default) currency according to the joomfish language the user switched to on my page. e.g. If the user switches to czech language, the prices are shown in czech crowns. In addition I will display the currency switcher module for languages that are not associated with only one currency (e.g. english).  Is there a possibility to &quot;link&quot; the language and the currency?  Thanx in advance")*

I did what Nicolas suggested but put it directly in index.php
Code:

// Set the currency at the first visit, regarding of the page language function set_currency($app) { $used_languages = [ [ "tag" =&gt; "en-us", "currency" =&gt; 2 ], [ "tag" =&gt; "ja-JP", "currency" =&gt; 3 ], [ "tag" =&gt; "en-GB", "currency" =&gt; 4 ], [ "tag" =&gt; "en-AU", "currency" =&gt; 6 ], [ "tag" =&gt; "zh-TW", "currency" =&gt; 111 ], [ "tag" =&gt; "ko-KR", "currency" =&gt; 145 ] ]; $lang = JFactory::getLanguage(); if(!$app-&gt;getUserState('com_hikashop.currency_id',0)) { foreach($used_languages as $language) { if ($language["tag"] == $lang-&gt;get('tag')) { $app-&gt;setUserState('com_hikashop.currency_id', $language["currency"]); header('Location: '.$_SERVER['REQUEST_URI']); exit(0); } } } }

and called the function here :
Code:

// Dispatch the application. $app-&gt;dispatch(); set_currency($app); // Mark afterDispatch in the profiler. JDEBUG ? $_PROFILER-&gt;mark('afterDispatch') : null;

I think this is the good way to do, you help the user the first time and after you let him free to choose which couple language/currency he wants.

Last edit: 13 years 10 months ago by [Stéphane Corbé](/forum/user/12579-stephane-corbe "View Stéphane Corbé's Profile"). Reason: Format

The following user(s) said Thank You: [nicolas](/forum/user/63-nicolas "View nicolas's Profile")

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzg3NzYtZGVmYXVsdC1jdXJyZW5jeS1kZXBlbmRpbmctb24tbGFuZ3VhZ2U/c3RhcnQ9MjAmdG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[Karloz](/forum/user/3250-karloz "View Karloz's Profile")**
- [![Karloz's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/3250-karloz "View Karloz's Profile")
- [ Offline](/forum/user/3250-karloz)

Less More

- Posts: 45
- Thank you received: 0
-
-

13 years 1 month ago [\#124416](#124416) by [Karloz](/forum/user/3250-karloz "View Karloz's Profile")  Replied by *[Karloz](/forum/user/3250-karloz "View Karloz's Profile")* on topic *[default currency depending on language](/forum/4-how-to/8776-default-currency-depending-on-language?start=20#124416 "Hi,  I am using Hikashop Essential so I have no option of using the geolocation plugin for this issue.  It would be very useful for me to change the displayed (default) currency according to the joomfish language the user switched to on my page. e.g. If the user switches to czech language, the prices are shown in czech crowns. In addition I will display the currency switcher module for languages that are not associated with only one currency (e.g. english).  Is there a possibility to &quot;link&quot; the language and the currency?  Thanx in advance")*

Hello, please where should i put the code ?

When i put both into index.php / template.php i got blank page (i'm using yootheme template)

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzg3NzYtZGVmYXVsdC1jdXJyZW5jeS1kZXBlbmRpbmctb24tbGFuZ3VhZ2U/c3RhcnQ9MjAmdG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[Karloz](/forum/user/3250-karloz "View Karloz's Profile")**
- [![Karloz's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/3250-karloz "View Karloz's Profile")
- [ Offline](/forum/user/3250-karloz)

Less More

- Posts: 45
- Thank you received: 0
-
-

13 years 1 month ago -  13 years 1 month ago [\#124445](#124445) by [Karloz](/forum/user/3250-karloz "View Karloz's Profile")  Replied by *[Karloz](/forum/user/3250-karloz "View Karloz's Profile")* on topic *[default currency depending on language](/forum/4-how-to/8776-default-currency-depending-on-language?start=20#124445 "Hi,  I am using Hikashop Essential so I have no option of using the geolocation plugin for this issue.  It would be very useful for me to change the displayed (default) currency according to the joomfish language the user switched to on my page. e.g. If the user switches to czech language, the prices are shown in czech crowns. In addition I will display the currency switcher module for languages that are not associated with only one currency (e.g. english).  Is there a possibility to &quot;link&quot; the language and the currency?  Thanx in advance")*

Oh I forgot, i'm using joomla 3 language translations, not falang.

Please any suggestion ?

Last edit: 13 years 1 month ago by [Karloz](/forum/user/3250-karloz "View Karloz's Profile").

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzg3NzYtZGVmYXVsdC1jdXJyZW5jeS1kZXBlbmRpbmctb24tbGFuZ3VhZ2U/c3RhcnQ9MjAmdG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[Jerome](/forum/user/80-jerome "View Jerome's Profile")**
- [![Jerome's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar80.png)](/forum/user/80-jerome "View Jerome's Profile")
- [ Offline](/forum/user/80-jerome)
- HikaShop core developer

Less More

- Posts: 26400
- Thank you received: 4080
-
- [](http://obsi.dev)
-

13 years 1 month ago [\#124547](#124547) by [Jerome](/forum/user/80-jerome "View Jerome's Profile")  Replied by *[Jerome](/forum/user/80-jerome "View Jerome's Profile")* on topic *[default currency depending on language](/forum/4-how-to/8776-default-currency-depending-on-language?start=20#124547 "Hi,  I am using Hikashop Essential so I have no option of using the geolocation plugin for this issue.  It would be very useful for me to change the displayed (default) currency according to the joomfish language the user switched to on my page. e.g. If the user switches to czech language, the prices are shown in czech crowns. In addition I will display the currency switcher module for languages that are not associated with only one currency (e.g. english).  Is there a possibility to &quot;link&quot; the language and the currency?  Thanx in advance")*

Hi,

It does not ask for Falang.
You have to put it in the Joomla index.php file, at the website root folder.

I don't understand why you put it in your "template.php" file.

If you got a blank page, it means that you wrote something wrong in PHP. Check your PHP log to have more details of the error.

Regards,

---

Jerome - Obsidev.com
HikaMarket &amp; HikaSerial developer / HikaShop core dev team.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzg3NzYtZGVmYXVsdC1jdXJyZW5jeS1kZXBlbmRpbmctb24tbGFuZ3VhZ2U/c3RhcnQ9MjAmdG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[Karloz](/forum/user/3250-karloz "View Karloz's Profile")**
- [![Karloz's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/3250-karloz "View Karloz's Profile")
- [ Offline](/forum/user/3250-karloz)

Less More

- Posts: 45
- Thank you received: 0
-
-

13 years 1 month ago -  13 years 1 month ago [\#124559](#124559) by [Karloz](/forum/user/3250-karloz "View Karloz's Profile")  Replied by *[Karloz](/forum/user/3250-karloz "View Karloz's Profile")* on topic *[default currency depending on language](/forum/4-how-to/8776-default-currency-depending-on-language?start=20#124559 "Hi,  I am using Hikashop Essential so I have no option of using the geolocation plugin for this issue.  It would be very useful for me to change the displayed (default) currency according to the joomfish language the user switched to on my page. e.g. If the user switches to czech language, the prices are shown in czech crowns. In addition I will display the currency switcher module for languages that are not associated with only one currency (e.g. english).  Is there a possibility to &quot;link&quot; the language and the currency?  Thanx in advance")*

Oh i see, i was putting it in the template file - index.php / template.php

Anyway it still doesn't work when i put the code in the root index.php, no currency changes, nothing in log
I changed the language tags and currency id's.

Is there something else what has to be done ? Like currency module visible or ... ?

Last edit: 13 years 1 month ago by [Karloz](/forum/user/3250-karloz "View Karloz's Profile").

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzg3NzYtZGVmYXVsdC1jdXJyZW5jeS1kZXBlbmRpbmctb24tbGFuZ3VhZ2U/c3RhcnQ9MjAmdG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[Jerome](/forum/user/80-jerome "View Jerome's Profile")**
- [![Jerome's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar80.png)](/forum/user/80-jerome "View Jerome's Profile")
- [ Offline](/forum/user/80-jerome)
- HikaShop core developer

Less More

- Posts: 26400
- Thank you received: 4080
-
- [](http://obsi.dev)
-

13 years 1 month ago [\#124565](#124565) by [Jerome](/forum/user/80-jerome "View Jerome's Profile")  Replied by *[Jerome](/forum/user/80-jerome "View Jerome's Profile")* on topic *[default currency depending on language](/forum/4-how-to/8776-default-currency-depending-on-language?start=20#124565 "Hi,  I am using Hikashop Essential so I have no option of using the geolocation plugin for this issue.  It would be very useful for me to change the displayed (default) currency according to the joomfish language the user switched to on my page. e.g. If the user switches to czech language, the prices are shown in czech crowns. In addition I will display the currency switcher module for languages that are not associated with only one currency (e.g. english).  Is there a possibility to &quot;link&quot; the language and the currency?  Thanx in advance")*

Hi

> // Set the currency at the first visit, regarding of the page language

If you are sure you made the right modifications, it should set the currency depending the langue on the first visit.
To test it, clean your cookies. You have to open the website like if you was the first time.

Regards,

---

Jerome - Obsidev.com
HikaMarket &amp; HikaSerial developer / HikaShop core dev team.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzg3NzYtZGVmYXVsdC1jdXJyZW5jeS1kZXBlbmRpbmctb24tbGFuZ3VhZ2U/c3RhcnQ9MjAmdG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[Karloz](/forum/user/3250-karloz "View Karloz's Profile")**
- [![Karloz's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/3250-karloz "View Karloz's Profile")
- [ Offline](/forum/user/3250-karloz)

Less More

- Posts: 45
- Thank you received: 0
-
-

13 years 1 month ago [\#124569](#124569) by [Karloz](/forum/user/3250-karloz "View Karloz's Profile")  Replied by *[Karloz](/forum/user/3250-karloz "View Karloz's Profile")* on topic *[default currency depending on language](/forum/4-how-to/8776-default-currency-depending-on-language?start=20#124569 "Hi,  I am using Hikashop Essential so I have no option of using the geolocation plugin for this issue.  It would be very useful for me to change the displayed (default) currency according to the joomfish language the user switched to on my page. e.g. If the user switches to czech language, the prices are shown in czech crowns. In addition I will display the currency switcher module for languages that are not associated with only one currency (e.g. english).  Is there a possibility to &quot;link&quot; the language and the currency?  Thanx in advance")*

All the time I thought it will be changing the currency along with language switcher, doesn't it ?
Not just for the first visit, i thought for that is the geolocation plugin.

Please how could i be changing the currency together with joomla language switcher module ?

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzg3NzYtZGVmYXVsdC1jdXJyZW5jeS1kZXBlbmRpbmctb24tbGFuZ3VhZ2U/c3RhcnQ9MjAmdG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[Xavier](/forum/user/4105-xavier "View Xavier's Profile")**
- [![Xavier's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar4105.png)](/forum/user/4105-xavier "View Xavier's Profile")
- [ Offline](/forum/user/4105-xavier)

Less More

- Posts: 13201
- Thank you received: 2322
-
-
-
- [](http://www.kidiweb.fr)
-

13 years 1 month ago [\#124678](#124678) by [Xavier](/forum/user/4105-xavier "View Xavier's Profile")  Replied by *[Xavier](/forum/user/4105-xavier "View Xavier's Profile")* on topic *[default currency depending on language](/forum/4-how-to/8776-default-currency-depending-on-language?start=20#124678 "Hi,  I am using Hikashop Essential so I have no option of using the geolocation plugin for this issue.  It would be very useful for me to change the displayed (default) currency according to the joomfish language the user switched to on my page. e.g. If the user switches to czech language, the prices are shown in czech crowns. In addition I will display the currency switcher module for languages that are not associated with only one currency (e.g. english).  Is there a possibility to &quot;link&quot; the language and the currency?  Thanx in advance")*

Hi,

You can create a little system plugin which will be called at each page load to change the currency depending on the language.
The code in a previous post can be used and adapted for your needs.
It require php knowledge.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzg3NzYtZGVmYXVsdC1jdXJyZW5jeS1kZXBlbmRpbmctb24tbGFuZ3VhZ2U/c3RhcnQ9MjAmdG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[Karloz](/forum/user/3250-karloz "View Karloz's Profile")**
- [![Karloz's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/3250-karloz "View Karloz's Profile")
- [ Offline](/forum/user/3250-karloz)

Less More

- Posts: 45
- Thank you received: 0
-
-

13 years 1 month ago [\#124724](#124724) by [Karloz](/forum/user/3250-karloz "View Karloz's Profile")  Replied by *[Karloz](/forum/user/3250-karloz "View Karloz's Profile")* on topic *[default currency depending on language](/forum/4-how-to/8776-default-currency-depending-on-language?start=20#124724 "Hi,  I am using Hikashop Essential so I have no option of using the geolocation plugin for this issue.  It would be very useful for me to change the displayed (default) currency according to the joomfish language the user switched to on my page. e.g. If the user switches to czech language, the prices are shown in czech crowns. In addition I will display the currency switcher module for languages that are not associated with only one currency (e.g. english).  Is there a possibility to &quot;link&quot; the language and the currency?  Thanx in advance")*

Well i guess it would be better to integrate the changes into language switcher to be able to alternate the currency via currency switcher then as well.

Its also because we are using Joomla articles to display products, where the currency module doesn't affect displayed price.
And currency switcher is displayed just on the checkout page.

Anyway thank you very much.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzg3NzYtZGVmYXVsdC1jdXJyZW5jeS1kZXBlbmRpbmctb24tbGFuZ3VhZ2U/c3RhcnQ9MjAmdG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[Hátle](/forum/user/17167-hatle "View Hátle's Profile")**
- [![Hátle's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/17167-hatle "View Hátle's Profile")
- [ Offline](/forum/user/17167-hatle)

Less More

- Posts: 15
- Thank you received: 0
-
-

13 years 1 month ago [\#124758](#124758) by [Hátle](/forum/user/17167-hatle "View Hátle's Profile")  Replied by *[Hátle](/forum/user/17167-hatle "View Hátle's Profile")* on topic *[default currency depending on language](/forum/4-how-to/8776-default-currency-depending-on-language?start=20#124758 "Hi,  I am using Hikashop Essential so I have no option of using the geolocation plugin for this issue.  It would be very useful for me to change the displayed (default) currency according to the joomfish language the user switched to on my page. e.g. If the user switches to czech language, the prices are shown in czech crowns. In addition I will display the currency switcher module for languages that are not associated with only one currency (e.g. english).  Is there a possibility to &quot;link&quot; the language and the currency?  Thanx in advance")*

> integrate the changes into language switcher

I would be interested in this solution too, if possible.

Thank you

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzg3NzYtZGVmYXVsdC1jdXJyZW5jeS1kZXBlbmRpbmctb24tbGFuZ3VhZ2U/c3RhcnQ9MjAmdG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[bonzomedia](/forum/user/1859-bonzomedia "View bonzomedia's Profile")**
- [![bonzomedia's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/1859-bonzomedia "View bonzomedia's Profile")
- [ Offline](/forum/user/1859-bonzomedia)

Less More

- Posts: 131
- Thank you received: 7
-
-

10 years 5 months ago [\#242417](#242417) by [bonzomedia](/forum/user/1859-bonzomedia "View bonzomedia's Profile")  Replied by *[bonzomedia](/forum/user/1859-bonzomedia "View bonzomedia's Profile")* on topic *[default currency depending on language](/forum/4-how-to/8776-default-currency-depending-on-language?start=20#242417 "Hi,  I am using Hikashop Essential so I have no option of using the geolocation plugin for this issue.  It would be very useful for me to change the displayed (default) currency according to the joomfish language the user switched to on my page. e.g. If the user switches to czech language, the prices are shown in czech crowns. In addition I will display the currency switcher module for languages that are not associated with only one currency (e.g. english).  Is there a possibility to &quot;link&quot; the language and the currency?  Thanx in advance")*

I came across this requirement for my Swiss website where I needed to change the currency depending on de-DE (German German) or de-CH (German Swiss). If German prices to be shown in Euros, if Swiss prices to be shown in Swiss Francs (CHF).

Fortunately, I found this thread! Anyway, I've created a small plug-in called: CurrencyFollowsLanguage which simply maps a system language tag to a hikashop currency ID. You can set up these maps (up to 10, easily extended), in the plugin backend.

Zip file of the plug-in attached.

The following user(s) said Thank You: [dyvel](/forum/user/39996-dyvel "View dyvel's Profile")

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzg3NzYtZGVmYXVsdC1jdXJyZW5jeS1kZXBlbmRpbmctb24tbGFuZ3VhZ2U/c3RhcnQ9MjAmdG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

Board Categories HikaShop Install &amp; Update Product &amp; Category Display Content Creation Sales and Orders Orders management Reports &amp; Statistics Customers Checkout Payment Methods Shipping Methods Import &amp; Export (CSV, XLS…) Specific Features Affilation Taxes Wishlist Vote Carousel &amp; Slider Mass Actions Filters &amp; Search Discount &amp; Coupon Feature Request Integrations Showcase General Talk about HikaShop Development HikaShop 3.0 Beta Translation Commercial Jobs HikaShop Components HikaMarket Market: Feature requests Market: How to? Market: Bug Report HikaSerial General talk about HikaSerial Serial: Bug Report Serial: How to? Support en Français de HikaSerial (French Support) HikaSubscription HikaAuction Auction: Feature requests Auction: How to? Auction: Bug report Hikashop around the world Support en Français (French Support) Russian FAQ. Курс выживания с Hikashop. Частые вопросы и о Расширения Hikashop Наши сайты на Hikashop 日本語版サポート(Japanese Support) Thai German Archives Bug Report How to?

[](/forum/topics/feed/mode-topics?format=feed&type=rss)

Time to create page: 0.083 seconds

[Powered by](/forum/credits) [Kunena Forum](https://www.kunena.org)
