Anders Posted March 14, 2019 Share Posted March 14, 2019 hi guys, i found that i could put a currency in lang code like this below, but were do i add the code? Selecting Currency ID 2 and the Spanish language http://demo.whmcs.com/cart.php?currency=2&language=Spanish 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted March 14, 2019 Share Posted March 14, 2019 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 ? 0 Quote Link to comment Share on other sites More sharing options...
Anders Posted March 14, 2019 Author Share Posted March 14, 2019 when they choose a lang it change the currency english will be pounds and german euro and so on... 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted March 14, 2019 Share Posted March 14, 2019 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> to... <a href="{$currentpagelinkback}language={$locale.language}{if !$loggedin}{if $locale.language eq 'english'}¤cy=1{elseif $locale.language|in_array:['catalan','dutch','french','german','italian','portuguese-pt','spanish']}¤cy=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. Quote 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. 0 Quote Link to comment Share on other sites More sharing options...
Anders Posted March 14, 2019 Author Share Posted March 14, 2019 super thx Brian it works amazing :) 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted March 15, 2019 Share Posted March 15, 2019 19 hours ago, andersbirkenstam said: super thx Brian it works amazing 🙂 which one - my quick hack or the ModulesGarden hook ?? 0 Quote Link to comment Share on other sites More sharing options...
Anders Posted March 15, 2019 Author Share Posted March 15, 2019 your quick hack :) 0 Quote Link to comment Share on other sites More sharing options...
ETS Posted April 5, 2019 Share Posted April 5, 2019 Hello, I need your help please. I already have English an Spanish versions of my website and I'm working on Portuguese translation. The link I normally use to provide a Spanish version of the order page looks like this: https://mywebsite.com/cart.php?a=add&pid=2currency=2&language=Spanish That doesn't work for the Portuguese version when I make it https://mywebsite.com/cart.php?a=add&pid=2currency=2&language=Portuguese Waiting for your answer. Thanks 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted April 8, 2019 Share Posted April 8, 2019 On 05/04/2019 at 12:58, ETS said: That doesn't work for the Portuguese version when I make it https://mywebsite.com/cart.php?a=add&pid=2currency=2&language=Portuguese there are two different Portuguese language files in WHMCS - one for Portuguese and another for Portuguese (Brazil).. for customers using Portuguese, the link would be -> https://mywebsite.com/cart.php?a=add&pid=2currency=2&language=portuguese_pt if you have customers using Portuguese (Brazil), the link would be -> https://mywebsite.com/cart.php?a=add&pid=2currency=2&language=portuguese_br (you might need to change the currency value for Brazilian customers). 0 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.