edwardmill Posted August 30, 2013 Share Posted August 30, 2013 Hello Guys, I have question. I want to know how do i set my whole website with the country base. Like Suppose i am in Australia right i click on http://www.yourdomain.com but domain is showing me http://www.yourdomain.au. and whole website prices has change it showing me in Australian dollar You get me ? Suppose now i am in United Kingdom i click on http://www.yourdomain.com but domain is showing me http://www.yourdomain.co.uk and whole website prices has change into pound. You get me ? Suppose now i am in France i click on http://www.yourdomain.com but domain is showing me http://www.yourdoman.fr and whole website prices has changed into Euro you get me ? I hope you will understand my main what i am trying to know. I hope everyone will give me some good idea and information. Regard Edward. 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted August 30, 2013 Share Posted August 30, 2013 a simple way around this would be to have a currency selector on the site... so click the USA flag, and their currency is set to US Dollars; click UK flag and currency is set to Sterling etc.. could also assign a language at the same time. I outlined this in a post a few days ago... http://forum.whmcs.com/showthread.php?77818-Currency-selector a more automated way was mentioned in the WHMCS blog below - I don't know if it works with the latest version though. http://blog.whmcs.com/?t=67990 remember that this is only useful for new clients - I think existing clients who have already purchased a service from you cannot change their currency... you can change their currency in admin, but it would just change the currency of their invoices without adjusting the amounts ($100 is a little different than £100 !) 0 Quote Link to comment Share on other sites More sharing options...
edwardmill Posted August 31, 2013 Author Share Posted August 31, 2013 a simple way around this would be to have a currency selector on the site... so click the USA flag, and their currency is set to US Dollars; click UK flag and currency is set to Sterling etc.. could also assign a language at the same time. I outlined this in a post a few days ago... http://forum.whmcs.com/showthread.php?77818-Currency-selector a more automated way was mentioned in the WHMCS blog below - I don't know if it works with the latest version though. http://blog.whmcs.com/?t=67990 remember that this is only useful for new clients - I think existing clients who have already purchased a service from you cannot change their currency... you can change their currency in admin, but it would just change the currency of their invoices without adjusting the amounts ($100 is a little different than £100 !) I have tried the http://blog.whmcs.com/?t=67990 but i don't like this one because this method only change the cart.php currency not whole the template currency. I want to change the whole template currency. that what i am looking for. you get me ? 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted August 31, 2013 Share Posted August 31, 2013 i'm still getting you! if you check out my second to last post on the currency selector thread above, that will tell you how to add links to header.tpl so that the option to change currency is available on every page (unless logged in or you only have one currency in whmcs). using that method, the currency selection remains in place on all pages of the site, unless the user either changes it, or they log in. but going back to your original question, there is a way to do what you outline, i.e having domains go to specific currencies and/or languages... actually, it might be the reverse of what you want to do, but I think the outcome is the same! let's say you have whmcs installed on yourdomain.com and the default currency is US Dollars... you also have additional currencies set of Australian Dollars, UK Sterling and Euro. you could forward visitors to yourdomain.com.au onto yourdomain.com/index.php?currency=2 and that would display the site with prices in Australian Dollars - not just the cart, but any price tables too. similarly, yourdomain.co.uk -> yourdomain.com?currency=3 yourdomain.eu -> yourdomain.com?currency=4 now, I don't currently use multiple currencies and i've deleted the additional currency I added to test the previous code I mentioned, but I see no reason why the above wouldn't work - in fact, it's mentioned in the documentation, so it must work! of course without using a method similar to that mentioned in the blog and determining the user's location, there's nothing to stop a customer going to any of the four domains - though if the currencies are setup correctly, it shouldn't matter as the prices should be equivalent - as they're all being redirected to the one site. 0 Quote Link to comment Share on other sites More sharing options...
edwardmill Posted August 31, 2013 Author Share Posted August 31, 2013 (edited) i'm still getting you! if you check out my second to last post on the currency selector thread above, that will tell you how to add links to header.tpl so that the option to change currency is available on every page (unless logged in or you only have one currency in whmcs). using that method, the currency selection remains in place on all pages of the site, unless the user either changes it, or they log in. but going back to your original question, there is a way to do what you outline, i.e having domains go to specific currencies and/or languages... actually, it might be the reverse of what you want to do, but I think the outcome is the same! let's say you have whmcs installed on yourdomain.com and the default currency is US Dollars... you also have additional currencies set of Australian Dollars, UK Sterling and Euro. you could forward visitors to yourdomain.com.au onto yourdomain.com/index.php?currency=2 and that would display the site with prices in Australian Dollars - not just the cart, but any price tables too. similarly, yourdomain.co.uk -> yourdomain.com?currency=3 yourdomain.eu -> yourdomain.com?currency=4 now, I don't currently use multiple currencies and i've deleted the additional currency I added to test the previous code I mentioned, but I see no reason why the above wouldn't work - in fact, it's mentioned in the documentation, so it must work! of course without using a method similar to that mentioned in the blog and determining the user's location, there's nothing to stop a customer going to any of the four domains - though if the currencies are setup correctly, it shouldn't matter as the prices should be equivalent - as they're all being redirected to the one site. That's what i looking for brian. This is code is correct ? YOU GET ME ? {if ($smarty.server.REQUEST_URI|stristr:'cart.php')} {if ($smarty.server.REQUEST_URI|stristr:'currency')} <a href="{$smarty.server.REQUEST_URI|replace:'currency=2':'currency=1'}"> USD</a> <a href="{$smarty.server.REQUEST_URI|replace:'currency=1':'currency=2'}"> EUR</a> {else} <a href="{$smarty.server.REQUEST_URI}?currency=1"> USD</a> <a href="{$smarty.server.REQUEST_URI}?currency=2"> EUR</a> {/if} {/if} {if ($smarty.server.REQUEST_URI|stristr:'index.php') or ($smarty.server.REQUEST_URI|stristr:'domainchecker.php')} {if ($smarty.server.REQUEST_URI|stristr:'.php?')} <a href="{$smarty.server.REQUEST_URI}¤cy=1"> USD</a> <a href="{$smarty.server.REQUEST_URI}¤cy=2"> EUR</a> {else} <a href="{$smarty.server.REQUEST_URI}?currency=1"> USD</a> <a href="{$smarty.server.REQUEST_URI}?currency=2"> EUR</a> {/if} {/if} Edited August 31, 2013 by edwardmill 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted August 31, 2013 Share Posted August 31, 2013 yes, that's the code for adding links to different currencies in the header (or anywhere really) - you may want to replace text links with flag icons (which come with whmcs), but that's simple enough. the code needs an additional line to check that the user isn't logged in and there is more than one currency in whmcs. {if !$loggedin && $currencies} {if ($smarty.server.REQUEST_URI|stristr:'cart.php')} {if ($smarty.server.REQUEST_URI|stristr:'currency')} <a href="{$smarty.server.REQUEST_URI|replace:'currency=2':'currency=1'}"> USD</a> <a href="{$smarty.server.REQUEST_URI|replace:'currency=1':'currency=2'}"> EUR</a> {else} <a href="{$smarty.server.REQUEST_URI}?currency=1"> USD</a> <a href="{$smarty.server.REQUEST_URI}?currency=2"> EUR</a> {/if} {/if} {if ($smarty.server.REQUEST_URI|stristr:'index.php') or ($smarty.server.REQUEST_URI|stristr:'domainchecker.php')} {if ($smarty.server.REQUEST_URI|stristr:'.php?')} <a href="{$smarty.server.REQUEST_URI}¤cy=1"> USD</a> <a href="{$smarty.server.REQUEST_URI}¤cy=2"> EUR</a> {else} <a href="{$smarty.server.REQUEST_URI}?currency=1"> USD</a> <a href="{$smarty.server.REQUEST_URI}?currency=2"> EUR</a> {/if} {/if} {/if} if you just wanted to forward domains with specific currencies set, then that would require no coding and would be setup on your server - though you may need to use .htaccess, but more likely you'd be able to do it through your hosting panel. 0 Quote Link to comment Share on other sites More sharing options...
edwardmill Posted September 1, 2013 Author Share Posted September 1, 2013 yes, that's the code for adding links to different currencies in the header (or anywhere really) - you may want to replace text links with flag icons (which come with whmcs), but that's simple enough. the code needs an additional line to check that the user isn't logged in and there is more than one currency in whmcs. if you just wanted to forward domains with specific currencies set, then that would require no coding and would be setup on your server - though you may need to use .htaccess, but more likely you'd be able to do it through your hosting panel. Hi i hope you will fine. Brian i want to know in which template i have to put these codes ? Can you tell me step by step so i can understand. I don't want to play around you get me ? Regard. 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted September 1, 2013 Share Posted September 1, 2013 Brian i want to know in which template i have to put these codes ? Can you tell me step by step so i can understand. it depends where you want to flags/links to be on the site - if its at the top, then it will go in header.tpl in your template directory. I can't tell you exactly where as I think you mentioned that you are using a custom template - probably the easiest way is trial & error... so find where you want to display it, then find the code in header.tpl that creates that bit of the site and paste the above code in... 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.