Jump to content

currency in lang code

Recommended Posts

Just now, andersbirkenstam said:

i found that i could put a currency in lang code like this below, but were do i add the code?

as per the documentation, it's normally used in links, e.g if you want to specify a currency or a language used when a client sees a page / product... what do you want to do with it ?

Share this post

Link to post
Share on other sites
50 minutes ago, andersbirkenstam said:

when they choose a lang it  change the currency english will be pounds and german euro and so on...

the simplistic way to do that would be to edit header.tpl and change...

<a href="{$currentpagelinkback}language={$locale.language}">{$locale.localisedName}</a>


<a href="{$currentpagelinkback}language={$locale.language}{if !$loggedin}{if $locale.language eq 'english'}&currency=1{elseif $locale.language|in_array:['catalan','dutch','french','german','italian','portuguese-pt','spanish']}&currency=14{/if}{/if}">{$locale.localisedName}</a>

you'd have to change the currency values to suit your own installation settings, but it would work and would only apply to clients who were not logged in - as clients cannot change their currency.

one problem with this solution would be those users that chose English as their language - are they from the UK (Pound), Ireland (Euro), USA (USD), Australia (AUD), New Zealand (NZD) ???

therefore, it might be better for you to use the free Geolocation Hook from ModulesGarden - with that, you can define a language and/or currency for each country and will therefore be more accurate than the above code.


Automate the switch of a currency, language or even the template of your WHMCS client area depending on the location of your audience. Upon detection of a country from where each of your visitors is, these crucial elements of your website will be adjusted instantly to secure customer experience that is personalized to perfection.

Under quick and very simple configuration, you will be able to benefit from MaxMind GeoIP2 or apply your own submodule to identify the location of not logged in users. As another option, you can choose the template to be changed according to the device used, be it a tablet or a mobile, or even the domain your visitor was redirected from. The hook will grant you the flexibility to select specific pages of your website where the alteration of its components should be performed. It will be also up to you whether to permit your clients to personally switch the currency.

Share this post

Link to post
Share on other sites
19 hours ago, andersbirkenstam said:

super thx Brian it works amazing 🙂

which one - my quick hack or the ModulesGarden hook ??

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.


Important Information

By using this site, you agree to our Terms of Use & Guidelines