We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 10449
    • 956 Posts
    A recent forum discussion (http://modxcms.com/forums/index.php/topic,21096.0.html) sparked this little script.

    What does it do?

    a) You can auto-update currency rates. The rates are stored in an extra database-table. The data provider is Yahoo!. First of all because it’s free, and also because Y! offers a convenient format for parsing (.csv).

    b) You can use the included snippet to convert between any two currencies.
    [!currencyConvert? &src=`EUR` &target=`CHF` &amount=`100`!]


    Possible uses: You have some sort of product catalogue or shop, and want to display prices in more than just your default currency. This is more user-friendly for your site-visitors than just linking to an external rate calculator, and more efficient for the site-admin when it comes to updating your rates.

    Download the ZIP here: http://www.screengang.com/stuff/currency-fetch-modx.zip
    I’ve written a step-by-step "read me" file that’s included as PDF.

    The only requirement for the auto-updater is that you are able to set up your own crontabs. Most serious webhosting companies allow this easily through their control panel.

    If people think this is useful, I’ll add it to the repository.

    Cheers, and happy X-Mas smiley