We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 8822
    • 203 Posts
    How do you determine what country a visitor to your website is browsing from? I want to show dollars as the default in a dropdown box if they are viewing from the US and pounds if they are viewing from the UK? Anyone know how to do this, or is it not as simple as i think?

    There might be a better way of doing this too, i.e. looking at system locale............open to suggestions!

    (Revo 2.2.6) [ed. note: Emily last edited this post 13 years, 8 months ago.]
      • 9207 ☆ A M B ☆
      • 2,475 Posts
      You should be able to get the $_SERVER['HTTP_ACCEPT_LANGUAGE'] parameter via a Snippet, and then you could return a the appropriate currency symbol.

      http://stackoverflow.com/questions/2156231/how-do-you-detect-a-website-visitors-country-specifically-us-or-not

      You could do this via the MODx lexicon too, but that seems like it's overly complicated for this particular use-case.
        • 22840
        • 1,572 Posts
        Just out of interest is the $ £ all you need to change ?, surely the price would change ?

        IE $20 is not £20 ?
          • 8822
          • 203 Posts
          Thanks Everett, will take a look at that

          Paul, Yes you are right, the price will also change, but i am planning on automatically updating the amount from say 100 to 250 if the currency changes from £ to $. It is only the one software product that is being sold so should be fairly simple to do this.