Currency Conversion WordPress Plugin

Allows you to display an amount in one currency automatically converted to the equivalent amount in the visitor’s local currency.

Download version 2016-05-31

The Xoogu Currency Conversion plugin for WordPress is designed to make it easy to convert an amount from one currency to another. The plugin provides a shortcode (with a quick add button in the editor) that can be used in posts and pages to wrap amounts that you would like to be converted. An API is also provided to allow other plugin developers to convert amounts using this plugin.

The main idea is that this will allow you to display amounts to your readers in their native currency. For example, in a post you might write

It cost me [currencyConversion]$35[/currencyConversion].

A Canadian reader would then see:

It cost me $35 (37.27 CAD).

The exact format of the replacement amount can be specified in the plugin settings.

How to use

Xoogu Currency Conversion has been designed to be easy to use. It includes a button for both the Rich Text Editor and HTML Editor that allows you to quickly and easily add the shortcode into a post or page.

Visual editor

  1. In the editor, select the currency amount you want to be displayed as a converted amount. This can include any currency symbol or code, not just the numeric amount.

  2. Click the currency conversion button – the button has a `$` and `€` on it.

    Highlight the amount to display as converted and click the button

  3. In the editor you’ll now see the text you had selected is wrapped with the currencyConversion shortcode.

    Currency conversion shortcode inserted

  4. If you want to use some settings specific to this shortcode, such as changing the ‘from’ currency or the format of the converted amount replacement, then instead of clicking the main button, click the little drop-down arrow to the right of the button. This will pop up an option to ‘Choose shortcode settings’

    Choose shortcode settings drop-down option

  5. Clicking this will pop up a dialog box. Set any of the shortcode options you want, then click insert shortcode.

    Insert shortcode dialog options

  6. In the editor you’ll now see the text you had selected is wrapped with the currencyConversion shortcode.

HTML editor

  1. In the editor, select the currency amount you want to be displayed as a converted amount. This can include any currency symbol or code, not just the numeric amount.

  2. Click the currency conversion button – the button has `$ => €` on it.

  3. Clicking this will pop up a dialog box. Set any of the shortcode options you want (normally you want to leave them all at the defaults), then click insert shortcode.

  4. In the editor you’ll now see the text you had selected is wrapped with the currencyConversion shortcode.


Installation

  1. Download the plugin zip file

  2. From the WordPress admin dashboard go to Plugins > Add New

    Add New plugin links in WordPress plugins dashboard

  3. From the add plugin screen choose the ‘Upload Plugin’ option near the top left

    Upload Plugin button on Add New Plugin page

  4. On the next screen click the Browse button in the center of the screen, then find the plugin zip file

    Browse for plugin zip button

  5. Click the Install Now button

    Install Now button after selecting plugin zip to install

  6. When the plugin has installed click the link to activate the plugin

    Activate plugin option when install completed

  7. (Optional) In the WordPress admin dashboard, find `Xoogu Currency Conversion` in the `Settings` menu to configure the plugin. It is recommended to set the default currency to convert from. You should also check that the Geo IP detection method is set.

    Plugin settings screen

Updating the plugin from an older version

  1. Deactivate the current version of the plugin.
  2. Delete the xoogu-currency-conversion folder from the /wp-content/plugins/ directory. (Note that if you use the delete plugin option from within the WordPress admin panel, this will also delete all your plugin settings. If you delete the folder via FTP then the plugin settings will be kept.)
  3. Follow the installation instructions above.

Conversion Rates (Exchange Rates)

The conversion rates are supplied by Yahoo! Finance. The plugin retrieves the latest rates on a daily basis. All rates are calculated against the US dollar. So, for example, converting GBP into EUR actually calculates the exchange of GBP into USD and then USD into EUR. This shouldn’t make any difference to the resulting amount, but makes the plugin much smaller than having to store the exchange rate between each currency and all other currencies.

Static rates

You can also choose to have the conversion rates saved when writing a post / page. This means that when anyone views your post in the future they will see the equivalent amount in their currency based on the conversion rate at the time the post was written, rather than the current conversion rate.

This can be achieved by adding static="1" as an attribute to the shortcode, or setting all instances of the shortcode to use static rates by default in the plugin settings.

Note that setting the static option to true in the plugin settings will make it so that any existing shortcodes will not convert the currency (since rates would not have been saved when those posts were written). If an old post is then edited and saved, the rates used will be from when the post saved, not when it was originally written.

When the static option is set to true in the plugin settings, or it is included as a shortcode attribute in a post/page, note that the conversion rates will be saved when this post is first saved. So if you write a post with static rates set, then publish it a month later, the conversion rates used will be based on when the post was first written, not when it was published.

Updating the rates

By default the plugin will fetch the latest exchange rates from Yahoo on a daily basis. However, you can configure how often the rates should update in the plugin settings.

Note that when using the static rates option, it is still important that the rates are updated regularly, as it is the last fetched rates that will be saved when saving a post with static rates.

If the plugin is used in a multisite environment, the most frequent update setting will be used (the exchange rate data is shared between all blogs on the site). So if one blog has the exchange rates update frequency set to daily, but another has it set to hourly, then the rates will be updated hourly.

Geo IP lookup

The plugin looks up a visitor’s country based on their IP address, however the plugin does not include this functionality itself. Instead it supports a number of external methods to do this (in order of preference):

  1. Web server with GeoIP extension installed
  2. PHP GeoIP extension
  3. WordPress GeoIP Detection plugin
  4. WordPress IP2Location Variables plugin
  5. WordPress IP2Location Tags plugin
  6. WordPress IP2Location Redirection plugin
  7. WordPress IP2Location Country Blocker plugin
  8. ip2nation table

If your WordPress installation does not currently have Geo IP lookup ability, then I suggest installing one of the above plugins. Note that after installing the GeoIP Detection plugin you ideally should set it to use the Maxmind Geo Lite City data source.

Setting the data source to Maxmind Geo Lite City in the GeoIP Detection plugin settings

The IP2Location plugin does not actually need to be active for the plugin to be able to use it for GeoIP lookup. But it does need to have previously been activated at some point. Similarly, the Maxmind Geo Lite City database provided by the GeoIP Detection plugin can be used for GeoIP lookup even if the GeoIP Detection plugin is not currently active.

While the plugin will work with the ip2nation table, it is not recommended as it does not seem to be as accurate as the other sources and includes less countries.

Note that the plugin can be used without Geo IP functionality. You can specify a currency code as the to attribute of a shortcode to convert an amount to a specific currency, e.g.

[currencyConversion to=”AUD”]50 EUR[/currencyConversion]

would output:

50 EUR (74.36 AUD)

Specifying the currency to be converted from

If you will be using the currencyConversion shortcode to convert amounts mostly from the same currency (which will be the case for most people), then it is recommended to set the currency you will be using as the from currency in the plugin settings.

Currency conversion shortcode inserted

You can also specify the from currency in the shortcode attributes, e.g. [currencyConversion from="CAD"]$40.27[/currencyConversion]

Or you can use the from currency as part of the text wrapped in the shortcode, e.g. [currencyConversion]40.27 CAD[/currencyConversion] or [currencyConversion]CAD 40.27[/currencyConversion]

Finally, you can use the currency symbol as part of the text wrapped in the shortcode. However, note that this will only be used if a default currency has not been set in the plugin settings. It also requires that the currency symbol is at the start of the wrapped text and immediately followed by the amount.

E.g. [currencyConversion]$40.27[/currencyConversion] would use USD as the from currency. But [currencyConversion]$ 40.27[/currencyConversion] wouldn’t work as there is a space between the dollar sign and the number.

Add-ons

Four add-ons are included with the plugin. These add-ons are not activated by default. To activate them go to the Xoogu Currency Conversion plugin settings, then click on the ‘Show advanced settings’ link. Down at the bottom of the settings you’ll find the add-ons section where you can choose to activate the add-on.

Add-ons section of Currency Conversion plugin settings

For the two widget add-ons, after activating you will need to visit the widgets page (Appearance > Widgets). You’ll see there is now a widget called ‘Currency Conversion choose country’ (or ‘Currency Conversion choose currency’ depending on which add-on you activated) in the Available Widgets section, which you can add to your sidebar.

Currency Conversion Choose country widget in the list of available widgets after activating the Choose country widget add-on

Add-on: Choose currency widget

The choose currency widget add-on lets you add a widget to your site’s sidebar (or any widgitized area) that allows the user to manually choose their currency from a drop down list of all supported currencies. This chosen currency will then be used for conversions for that user, rather than guessing their currency based on their IP address.

Add-on: Choose country widget

The choose country widget add-on lets you add a widget to your site’s sidebar (or any widgitized area) that allows the user to manually choose their country from a drop down list of all supported countries. The chosen country’s currency will then be used for conversions for that user, rather than guessing their country / currency based on their IP address.

The widget can also be added anywhere that a shortcode can be used, simply use the shortcode [choose_country_widget /]

Add-on: Ajax

This add-on makes it so that rather than performing the conversions when a page is requested, the conversions are instead performed by javascript in the user’s browser. This is useful when using static page caching, such as with the W3 Total Cache or WP Super Cache plugins. It keeps the conversions dynamic so that a user will see rates converted to their local currency (with GeoIP enabled) rather than whatever the local currency was at the time the page was cached.

The Ajax add-on supports IE8 and later and Webkit 534.54.16 and later (and possibly earlier versions of Webkit). I haven’t tested on old versions of Gecko and Presto, but suffice to say that this add-on should work okay in any browser released in the last 4 years.

The ‘geoip-detect2’ geoIP lookup option (using the GeoIP Detection plugin) is not supported by the Ajax add-on. If you’re using this plugin, you should set it to use ‘Automatic download & update of Maxmind GeoIP Lite City’ as the data source (and ensure the data source has been installed). Then in the Currency Conversion plugin settings, choose ‘GeoIP Detection plugin MaxMind GeoLite City database’ as the GeoIP method. (The reason for this is that in order to keep load times fast the Ajax response does not fully load WordPress, and so plugins are not loaded. The MaxMind GeoLite City database can be used without having the GeoIP Detection plugin loaded.)

Note that because conversions are performed in the user’s browser, the user may see the unconverted rates on the page for a short time before the javascript kicks in and converts them.

Add-on: localCurrency

If you’ve previously been using the localCurrency plugin and want to switch (or just try out) this plugin instead, then you can activate this add-on. It will make the plugin handle all localcurrency shortcodes.

Note however, it does not make use of any of the localCurrency settings or static rates saved by the localCurrency plugin. It also does not support the old HTML comment style localcurrency tags.

Add-on: WooCommerce (beta)

This add-on enables displaying prices converted to the visitor’s local currency when using WooCommerce. Please note that it is only the display prices that are modified, the actual price and currency a visitor is charged remain unchanged.

This add-on is currently in beta. If you have any problems with prices not being displayed correctly please contact me with details of your setup (e.g. theme, what page and where prices aren’t displayed correctly, etc.) so I can try and reproduce the problem and get it fixed.

Multisite support

The plugin is intended to be compatible with a multisite environment. If the plugin is network activated you can additionally set the plugin’s settings sitewide in the Network Admin area. Normally when you save the settings in the Network Admin area, it will save those settings for all blogs on the network. The admins of those blogs can then modify the plugin settings via the standard plugins settings. So this can be useful if you want to set up the plugin with some default settings, but allow the individual blog admins to then change settings (such as the default currency) themselves.

However, if you choose the Network Only option from the Network Admin settings page, then only the Network Admin can change the plugin settings. The plugin settings will not be available to change on any of the individual blogs. This is much more efficient since it stores only one set of settings and uses one cron hook, rather than having to save different settings and use a separate cron hook for each blog.

Removing the plugin

Please note that the plugin adds a new table to the WordPress database. If you use the static rates option, this will also save further information to the database.

When the plugin is deactivated, all this data is left in the database. Therefore you can safely deactivate the plugin and then activate it again without fear of loosing any settings or saved static conversion rates.

To remove all the data the plugin adds to the database you can delete the plugin, but you must do this through the WordPress admin dashboard interface. If you delete the plugin by just manually deleting the folder and files, this will leave all the information added by the plugin in the database. (This issue applies to all WordPress plugins). So, it is important to always use the WordPress admin dashboard to delete any plugins you no longer want.

Note also, that if you installed the Geo IP detection plugin through the Currency Conversion plugin, the Geo IP detection plugin will not be automatically removed when the Currency Conversion plugin is removed. You will need to delete the Geo IP detection plugin as well if you no longer want it.

Posted on by xoogu, last updated

78 Responses to “Currency Conversion WordPress Plugin”

  1. Takashi says:

    Can I add a list of country to choose from on the sidebar widget or end of the page?

    • xoogu says:

      No, it will only convert to the user’s automatically detected currency, or to a currency specified in the shortcode. It’s a reasonable idea though, so I’ll add it the list of things to do for the next version.

  2. Takashi says:

    Thanks! As the Geolocation some area might not detect correctly so if there is such a option to choose will be prefect! What I’m referring was another WordPress plugin localcurrency. The bad thing about that is the ip2c it using not working correctly or detect effectively. May I know when will you be releasing the next version??

    • xoogu says:

      Sorry, but it will probably be a while, I am just about to go away for a month. Maybe in two months it might be ready.

  3. gurkan says:

    hello, thank you so much for this plugin.. I want to learn why is that plugin do not work some places like: http://prntscr.com/3m5iqz

    Not: its woking in post content..

    • xoogu says:

      Hi Gurkan

      I’m away at the moment, so I can’t really look into it much I’m afraid. One thing I noticed in the screenshot is that it looks like you are missing the slash from the closing short code tag. The closing tag should be [/currencyConversion].

      If that doesn’t work, do other shortcodes (e.g. ones built into wordpress or provided by other plugins) work okay in that spot?

      Dave

  4. gurkan says:

    thanks for your reply.. But still not working.. Neither other shortcodes… Thanks..

    • xoogu says:

      If other short codes don’t work either, then it sounds like short codes are not being processed for that part of the page. Do you know the name of the section that the shortcodes aren’t working in?

      • gurkan says:

        I am using a real estate theme and there is some fields in it.. (You can add any field.) I made a price field which is range value and it has overley markup section, in this section with %% symbols I get the price. Thanks..

        • xoogu says:

          It’s probably something to do with the way the theme was designed. Do you know the name of the theme?

          • gurkan says:

            Spotfinder real estate theme

          • xoogu says:

            Thanks for the info, I will have a look at the theme when I get back and see if there is a way to get the short codes working with it. Please bear in mind this will be in about a month though.

  5. gurkan says:

    Thank you so much..

  6. gurkan says:

    Hello, Is there any progress?

    • xoogu says:

      Hi Gurkan

      No progress yet, I only got back late last night I’m afraid. It will probably still be a few more days before I can look at it.

      Regards

      Dave

  7. gurkan says:

    thank you man.. if you can find a solution, I will donate 5$.. (coffee price)

    • Philip says:

      Hi Gurkan!

      Do u still got the same problem? Are u sure u write the shortcode on a page and not in your template file(.php) ? 🙂

      / Philip

      • xoogu says:

        Hi Philip

        The issue was with the theme, which used custom fields, gurkan was adding the shortcode in a custom field. But the theme wasn’t processing any shortcodes for the custom field. So the theme had to be edited to change it so that it would process shortcodes for that field.

        If anyone else is using the same theme (spot finder real estate), the fix is as follows:

        Find the file spotfinder/includes/search/functions/functions.php
        Line 47 of this file should read:
        return str_replace('%%', $value, $field_markup);
        Change this to:
        return do_shortcode(str_replace('%%', $value, $field_markup));

  8. Moozaique says:

    Hi!
    Thank you and congratulations for this really useful plugin.
    I have a question though : do you know how I could change the thousands separator? 1 thousand euros appears like this 1,000 EUR whereas in French (my users) the comma is only used for decimals.

    • Moozaique says:

      Hello again!
      I found the answer in my database. The thousands separator is well configured for French Euros but as I use the widget and not the Geo IP lookup it can’t see the difference between French and other countries euros…

      • xoogu says:

        Hi Moozaique

        Thanks for the feedback, so a widget to allow the user to choose their country would be useful. I didn’t think of the formatting differences before when I made the widget for choosing the currency. I will add it to my list of features to add.

        Regards

        Dave

        • Moozaique says:

          Thanks a lot for your quick answer.
          Yes choosing the country could be useful, but ony in very few particular cases like mine, and the issue only occurrs with euro I think.
          By the way, I have the same problem as Gurkan : I can’t use the shortcode in my template custom fields (Realia by Aviators). If you have a little time one day, I would be very grateful if you could have a look at it!
          Cheers

          • Moozaique says:

            Hi!
            Thanks to template support I managed to execute the shortcode in my custom fields.
            However, even after changing thousands separator in the database, I still get 1,000 EUR and so on. In fact, whatever currency I choose with the widget, I get comma as thousand separator. It works as if the country format details that you specified weren’t applied with the add-on…

          • xoogu says:

            Glad you got your theme modified okay, I didn’t have time to look at it yet.

            Thanks for letting me know about the issue with the separators, I’ll take a look at the plugin today and see if I can fix it.

          • xoogu says:

            Just to let you know, I am working on a fix for this issue, but it might still be a couple of days until I have an update of the plugin ready.

            At the moment, if no country is specified then the currency is always formatted using a ‘,’ as a thousands separator, and a ‘.’ as a decimal point.

  9. Moozaique says:

    Ok, thank you so much! Take your time, I’m not in a hurry, and I’m already very grateful for the help you provided me.

    • xoogu says:

      Hi

      I’ve updated the plugin now: https://static1.xoogu.com/files/currency-conversion-wordpress-plugin/xoogu-currency-conversion-1.2.0.zip

      The update instructions are here: https://www.xoogu.com/currency-conversion-wordpress-plugin/#installation-updating (deactivate and remove the old version, then upload and activate the new one).

      The new version will format Euro amounts in the German format when no country is specified. If you want to change this to use the French format, then edit the currency_details.csv before activating the plugin (or the wp_xoogu_currency_details database table after activating the plugin), find the entry for EUR and change the format_pref value (last column in the CSV file) from DE to FR.

      Alternatively, the plugin now includes a select by country widget, so you can just use that instead and then all users should see the amounts correctly formatted for their country. (Or use one of the GeoIP options and don’t use any of the widgets).

      Let me know if there are issues.

      Cheers

      Dave

      • Moozaique says:

        Hi Dave!
        It works like a charm! For me everything’s perfect.
        Now I’m gonna install your social sharing plugin 😉
        Thanks again for your very precious help.
        Séline

        • Moozaique says:

          Hmmm, sorry, it’s me again 🙁
          I didn’t pay attention to it in my first tests but in the choose currency widget my “auto” currency is now stuck on “USD” (whereas previously it displayed my original currency).
          It may not be caused by the widget because I made other changes since, and I can’t remember if the auto currency was working when I updated the plugin. To check this I reinstalled former version and USD also appears as auto value.
          So, my question is: how is the auto currency defined? Is it the original value we choose in “default currency to convert from”?
          Sorry to bother you again…

          • xoogu says:

            Hmm… I can’t actually remember how it determines what currency to use as the auto setting. I know that if you have the geo IP detection on, then it will show the geo detected currency as the auto setting. But I didn’t check it with the geo detection switched off.

            Unfortunately my hard drive I do all my web development work on broke today. But I’ll take a look at it when I can to see how it chooses the auto currency (and if it needs changing). Hopefully within a few days.

            Regards

            Dave

  10. Moozaique says:

    Ouch, no luck for your hard drive :-/
    I made the test and that’s indeed the geo IP detection (then my house is in French Polynesia and my garden in the US because it changed from auto XPF to auto USD overnight!!).
    With the geo detection switched off it just displays “auto unknown”.
    So everything’s ok for me, I just switched off the geo detection so that the conversion only happens when the user asks for it.
    Thanks again and again!
    Cheers

    • xoogu says:

      Glad you got it sorted okay! If you have a dynamic IP address, it could be that one day your IP address was one in the French Polynesia block, and the next day your ISP assigned you a different IP address that came under the US block (or somewhere ‘nearby’ that uses USD as its currency).

      The country detected from the IP address can also vary depending on the data the Geo IP plugin uses. So you might get a different result with a different Geo IP plugin.

      Detecting the country from the IP address will never be 100% accurate, but it should be correct for the vast majority of people.

  11. Takashi says:

    Apologies for the very late reply. It works perfectly! Thank you so much!

  12. chrisostomost says:

    Hi! Thanks for the great plugin!

    I client of mine needs to have prices in USD anywhere in the world, expect European Union where he needs EUR and United Kingdom where he needs GBP. I am not a scripting guru, but as far as I understand, I need to change all local currencies in the country_currency_map.csv to USD, leaving unchanged only EUR and GBP. And then install the plugin. Right?

    And a second thing. He needs static prices, but not defined by any currency converter. For example, $1000 should appear as £900 in UK.

    The only thing I managed to do so far was to hide the original price with %asy. 🙂

    I would really appreciate your help and I am more than happy to donate, if you accept donations.

    Thanks,
    chrisostomost

    • xoogu says:

      Hi chrisostomost

      I don’t think you will be able to do that with this plugin. However, it does sound like the sort of thing another plugin I have been intending to write would be able to do. If I have time over the next few days I’ll see if I can have a crack at it.

      The idea would be you’d write your text like this:

      The item costs [geo_text europe=”€1.200″ uk=”£900″]$1000[/geo_text]

      The user would then see €1.200 if they were in Europe, £900 if they were in the UK, or $1000 if they were anywhere else.

      Since this would be a general purpose plugin, europe would probably mean countries considered as being in europe, not just those using the euro. But if I do the same way of loading the data from a CSV file, then you would be able to edit the groupings before activating the plugin, and change it to only being countries that use the euro if you wanted.

      Does this sound like the kind of thing that would be useful?

      Dave

      • chrisostomost says:

        Hi Dave,

        thank you for your quick response! And yes, this is exactly what I need!!! How long do you think it will take to build this??? I am totally dependent on you.

        I suppose it is going to be a good/profitable plugin for you as well, as I can’t find anything similar. All plugins I found so far use a currency converter.

        Thanks again!

        • xoogu says:

          It’s very difficult for me to give an estimate as often there will be unforseen problems that pop up and can take some time to solve. I would say maybe a week, possibly longer, it also depends whether anything else more important crops up in the meantime.

          I have some work on a website I need to get finished first, then I should be able to get started on it.

          Regards

          Dave

    • Sam says:

      Hey chrisostomost

      How did you manage to hide the base currency?

      • xoogu says:

        Hi Sam

        You can hide the base currency by changing the replacement format code. If you want to do this for all instances, then go to the settings for the plugin, and click on the ‘Show advanced options’ link. Then find the ‘Replacement format’ section. Here you’ll see a description of all the different options you can use. If you use something like ‘%a %c’ then an amount like [currencyConversion]4,000 EUR[/currencyConversion] would be displayed as 4,575.79 USD to a visitor from the US. (%a is amount, %c is the ISO currency code).

        You can also change the format on an individual basis per instance of the shortcode, just use the ‘Replacement format’ setting when inserting the shortcode via the button in the editor. (Clicking the blue question mark icon next to the setting will show all the details of the different formatting settings available).

        Regards

        Dave

  13. Margus says:

    Hi, I love this plugin.
    Question, would it be possible to get currency or country “widget” to show on any page with a shortcode?

    My problem is that I can’t use widgets but really need the currency dropdown on somewhere on the page.

    Thanks.

    • xoogu says:

      Hi Margus

      I think I should be able to add that functionality, I’ll try and have a look at it sometime this weeek.

      Regards

      Dave

    • xoogu says:

      Hi Margus

      I’ve modified the choose country add-on so it can be used via a shortcode. Download the updated add-on here: https://static1.xoogu.com/files/currency-conversion-wordpress-plugin/choose-country-widget-2015-02-12.zip

      Unzip it and upload the contents over the existing choose-country-widget folder. (Inside the xoogu-currency-conversion plugin folder).

      In the plugin settings, click to show the advanced settings, and activate the choose country widget add-on.

      In your post add the shortcode [choose_country_widget /]

      Note that this just shows the form, so you might want to put your own title like ‘See amounts in your own currency, choose your country from the below’ in your post just before the shortcode.

      Regards

      Dave

      • Margus says:

        Thank you so much, works great.
        My only problem is that I use multisite and I don’t let users access options page. Is there a way to edit the plugin so that country widget add-on would be activated by default?
        Thanks

        • xoogu says:

          Hi Margus

          Thanks for the suggestion. At the moment that isn’t possible. I’ll see if I can add a Network Admin options page for the next version.

          Regards

          Dave

        • xoogu says:

          Hi Margus

          I’ve now updated the plugin with a settings page in the Network Admin area so you can do this. If you’re not allowing users to change the settings, then you should also choose the ‘Network only’ option on this settings page. (Only stores the settings once instead of storing separate settings for each blog on the multisite).

          The individual blog admins would still need to add the widget to their sidebars through.

          Regards

          Dave

          • Margus says:

            Wow, you are amazing. Everything works perfect.
            As soon as I get my site live and receive first payment, I’ll make u a donation.
            Thanks again.

  14. Mike says:

    Hi Dave,

    This plugin looks fantastic! Unfortunately it’s generating an error when I try to install and activate it.

    Plugin could not be activated because it triggered a fatal error.

    Parse error: syntax error, unexpected ‘(‘ in xoogu-currency-conversion/Xoogu_CurrencyConversion_Admin.php on line 242

    The line itself is:
    if (!empty( ($installed = $this->detectGeoIPinstalled()) )) {

    Have a great weekend,
    Mike

    • xoogu says:

      Hi Mike

      Thanks for letting me know! Interestingly my code editor shows an error on that line, but I had ignored it because it works fine for me and I couldn’t see anything wrong with the code (actually I still can’t).

      I’ve slightly modified that line now so the error message in my editor goes away, which I’m assuming should fix the error for you too. You can either download the latest version, or just change that line to:
      if (($installed = $this->detectGeoIPinstalled()) && !empty($installed)) {

      If you could let me know whether that does indeed get rid of the error or not I’d appreciate it.

      Cheers

      Dave

  15. Marcus says:

    I know it’s not to meant to use it like that but is it possible to display the country as text via shortcode?

    For example, if you are from Africa, text like “Prices in [country_shortcode] are cheaper than in America” would show “Prices in Africa are cheaper than in America”.

    Thanks.

    • Marcus says:

      Forgot to mention that I have PHP GeoIP Extension installed on apache and not using any GeoIP wordpress plugins.

      • xoogu says:

        For that you shouldn’t need any plugin at all. In your theme’s functions.php file, add the following:

        add_shortcode('country_shortcode', 'country_shortcodeHandler');
        function country_shortcodeHandler()
        {
        return geoip_country_name_by_name($_SERVER['REMOTE_ADDR']);
        }

        I don’t have the GeoIP Extension installed for PHP, so am unable to test it. But I think that should do what you’re wanting.

  16. David says:

    Hi, just wondering whether the plugin will have any issues with page cache in plugins such as W3TC.

    I encountered an issue with another plugin where the page cache fixed the currency converted to in the currency of the webhost’s location, so it stopped being dynamic based on the visitor’s location.

    Will this plugin have the same problem with page caches?

    • xoogu says:

      Hi David

      Yes, the plugin will have issues when used with caching. It shouldn’t fix the currency to the webhost’s location, but it will fix the currency to that of the visitor who first visits the page when it is not cached. If you pre-generate the cache, then it would fix the currency to the webhost’s location. I have a bit more information about the issues with caching and geo-targeted content here: Differences between caching methods with Geo targeted content

      If you want to use caching with this plugin (or any other plugin that outputs different content based on the user’s location) you’ll need to use partial caching (e.g. with my Dynamic Shortcodes extension for W3 Total Cache). Or geo caching (e.g. with my Geo Targeted Caching extension for W3 Total Cache).

      Kind regards

      Dave

      • David says:

        Thanks xoogu so much for your detailed response!

        I installed the Dynamic Shortcodes cache and followed the instructions for W3TC. Unfortunately I got this error upon saving the settings – “Unable to communicate with CloudFlare API: Setting: zone_settings Operation timed out after 5000 milliseconds with 0 bytes received.”

        Should I be worried about it?

      • David says:

        Hmm looks like there is a compatibility issue with the dynamic shortcodes extension and Cloudflare? the relevant shortcode is broken now and doesn’t display

        • xoogu says:

          Thanks for letting me know, I’ll try and take a look at it sometime over the next few days and see if I can find what the problem is.

          Dave

          • David says:

            Thanks xoogu, you’re a saviour 🙂

          • xoogu says:

            Hi David

            I’ve had a look at this now, but unfortunately the cloudflare and dynamic shortcode extensions are working together okay for me, so I can’t recreate the problem. In the W3TC Cloudflare settings, what do you have set for:
            Security level:
            Rocket Loader:
            Minification:
            Development mode:

            And have you changed any of the settings in your Cloudflare account dashboard from the defaults?

            It could be some specific choice of settings causing the problem – if I use the same settings as you then maybe I can recreate the problem (or if not, at least rule the settings out as being the cause).

            Finally, do you mean the shortcode doesn’t display anything on the page at all, or does it display the unprocessed shortcode, or some PHP code?

            Dave

          • David says:

            Hi xoogu,

            Settings are as follows:

            Security level: Low
            Rocket Loader: Automatic
            Minification: CSS, Javascript and HTML
            Development Mode: Off

            I don’t recall changing anything significant on the Cloudflare dashboard.

            Shortcode does not display at all, it doesn’t display anything.

            You were not able to see “Unable to communicate with CloudFlare API: Setting: zone_settings Operation timed out after 5000 milliseconds with 0 bytes received.”?

            Hmm. The main thing here is I do not use W3TC’s minification, and I prefer Cloudflare’s minification after some research on the effectiveness.

            Other than that on a free account there’s not many other settings to change really. I did enable all the settings under the Scrape Shield but I don’t think that should affect anything.

          • David says:

            Hmm… does this dynamic shortcodes extension require W3TC Pro to work?

          • xoogu says:

            Hi David

            It doesn’t require W3TC Pro. Can you let me know what plugin and shortcode it is you’re having trouble with. I haven’t been able to recreate the issue with your cloudflare settings, so I think it may be some incompatibility with the plugin you’re using. (I did try emailing you direct but I guess you either didn’t get it, or I didn’t get your reply).

            Many thanks

            Dave

  17. David says:

    Hi xoogu,

    Settings are as follows:

    Security level: Low
    Rocket Loader: Automatic
    Minification: CSS, Javascript and HTML
    Development Mode: Off

    I don’t recall changing anything significant on the Cloudflare dashboard.

    Shortcode does not display at all, it doesn’t display anything.

    You were not able to see “Unable to communicate with CloudFlare API: Setting: zone_settings Operation timed out after 5000 milliseconds with 0 bytes received.”?

    Hmm. The main thing here is I do not use W3TC’s minification, and I prefer Cloudflare’s minification after some research on the effectiveness.

    Other than that on a free account there’s not many other settings to change really. I did enable all the settings under the Scrape Shield but I don’t think that should affect anything.

  18. xoogu says:

    Hi Alice

    Unfortunately I can’t access your site at the moment, so I can’t see your example.

    If you don’t mind using fixed conversion rates then it would be much better to just do this using javascript, and don’t use my plugin at all. It sounds like you were updating the rates only once a year previously? Using a plain javascript solution would make it much easier to update the price, because you’d only need to update the exchange rates, rather than each of the prices individually. The exchange rates would need updating manually, but since you only have 3 currencies it should only take about 1 minute whenever you want to update them.

    My plugin is mainly useful if you want amounts converted to the user’s currency automatically. It could be used for the purpose you describe, but it would be a lot of overhead for only converting between 3 currencies, especially if exchange rates aren’t required to be updated regularly.

    If you used my plugin the amount of code you’d need to write to handle your specific use case would likely be similar to the amount of code needed to write a plain javascript solution from scratch.

    If I could see your site then I could suggest a plain js solution with static rates for you.

    Kind regards

    Dave

  19. sandeep says:

    hi dear,
    Thanks for this plugin BUT i have query about shortcode?
    If you can help me to solve out this my problem THEN its very big thanks from my team sir!!
    m using your shortcode for ip currency change on my e-commrerce blog but this code is not working clear with get my price with this get_price_html().[/currencyConversion]’);?>

    i want show my product price from woocommerce so that why m using this $product->get_price_html().

    can u tel me how can i solve this between shortcode????

    Regards

    SANDEEP

  20. Chris says:

    Hello,

    I’m wondering if it’s possible to reduce the number of countries/currencies that show up when using the widgets? Currently there’s 200+, but I’m only really interested in showing the major world currencies as options – USD, ASD, YEN, GBP, EUR etc..

    Is there a simple way to do this?

    Thanks so much in advance

    • xoogu says:

      Hi Chris

      There’s not a simple way to do that at the moment, but it’s a good idea so I’ll add it to my to-do list.

      To do what you’re looking for at the moment, you’ll need to add the widget to your site, then view a page with the widget on. The first time the widget is viewed it generates the list of currencies to choose from and saves it in a file: plugins/xoogu-currency-conversion/add-ons/choose-currency-widget/currency_select.html

      Open up this file and remove all the options you don’t want, then save it. Then only those options will show up in the widget for people to choose from.

      Dave

  21. Chris says:

    Thanks Dave – That worked a treat 🙂

    Is there a “simple way” to add the widget into the menu options – I know I can go through and add another plugin to the site. But I wonder if you had another one?

    Thanks for this 🙂

    • xoogu says:

      Hi Chris

      Apologies for the delayed reply. I’ve had a look at this now, and I can’t see any easy way of doing other than using a ‘widgets in menus’ plugin.

      Dave

  22. john says:

    hi..i am trying to install this plugin and i get a
    Parse error: syntax error, unexpected ‘[‘ in /hosting/davclubb/public_html/wp-content/plugins/xoogu-currency-conversion/lib/Dice/Dice.php on line 9

    please anyone who can help?

  23. jossan says:

    Hi,
    I have installed the plugin and it is working fine.
    but my requirement is little bit change as compared to
    the result.

    Plugin output result is: $USD 9.250 (12,031.47 AUD)
    But I want only: 12,031.47 AUD

    I don’t want show the added value only show the current currency value.

    How can is possible ?

    Please help me .

    Thanks,

    • xoogu says:

      Hi jossan

      You need to change the Replacement format. On the plugin settings page, click the ‘Show Advanced options’ link. Then find the section ‘Replacement format’. In there you can set how the converted amount is displayed. Change it to ‘%a %c’ and it should give you what you’re looking for.

      BTW, just to be clear, I guess that conversion $USD 9.250 (12,031.47 AUD) is correct? If you actually meant nine dollars twenty cents, then you need to remove the trailing zero, i.e. $USD 9.25 If you have three digits after a dot, then it treats the dot as a thousands seperator.

      Cheers

      Dave

  24. Simon G says:

    Hi,

    Love this plug-in for ease of use for user.

    On one of my websites I was able to limit the list of currencies available for users to convert into (I just chose 10 most popular currencies). For example our Discover Scuba page: http://www.baliscuba.com/padi-discover-scuba-in-bali-beginner-try-dive/

    However when I try to do the same thing on another of our sites I can’t find (remember) how to configure that. Instead users are presented with a huge list of every currency in the world (and not in alphabetical order).

    Can you remind me how to configure this?

    Thanks, Simon

    • xoogu says:

      Hi Simon

      I haven’t done any work on this plugin for ages, but having a quick look at it, after using the plugin if you look in the folder: plugins\xoogu-currency-conversion\add-ons\choose-currency-widget
      you should see a file in there called: currency_select.html
      Edit this file to remove all the options you don’t want and save it. (Or create a new file with only the options you want, then save that as currency_select.html in that folder.

      Or if you’re using the country widget, do the same with xoogu-currency-conversion\add-ons\choose-country-widget\country_select.html

      Cheers

      Dave

      • Simon G says:

        Thanks. That works. Appreciate very much your providing such great support for this free plug-in.

  25. Janus says:

    Seems like this plugin doesn’t work anymore. Url to the json file has changed, and it’s maybe formatted differently now.

    This seems like a working url: https://query1.finance.yahoo.com/v7/finance/options/AAPL

    Cheers!

  26. Marcus says:

    This is a really good plugin and been using it for years. Noticed it’s not working anymore (not getting/updating currency list). Any chance you can update it? 🙂
    Thanks.

Leave a Reply