WooCommerce Currency Switcher

# FOX - Currency Switcher Professional for WooCommerce v.2.4.3

## Multi Currency and Multi Pay for WooCommerce

FAQ The Plugin Demo Site Buy the Plugin

- Created: 24-06-2014 (dd-mm-yy)
- Latest update: 20-06-2025 (dd-mm-yy)
- By: realmag777
- Site: www.currency-switcher.com
- Support: here

Thanks you for buying of my plugin. I hope its will give for your site more power and more fun for your clients =)

### INFO!

Before upgrading free version to the premium one on your site - uninstall completely free version, and do not worry about settings as they are keeped in the Data Base of the site.
Also read next:

- I just bought the plugin and cant install it. Error!!
- How to make auto-update for WordPress plugins and themes bought on Envato

### Tab Currencies and Options

1. At the end we have to get something like this on the plugin settings page:
2. Install and activate the plugin
3. Go to WooCommerce settings -> tab "Currencies"
4. There will be 2 currencies installed by default: USD and EUR
5. REMEMBER: BASE CURRENCY ALWAYS MUST BE EQUAL TO 1 AS ON THE SCREEN ABOVE!!
6. Check radio button to set your site basic currency
7. Press 'Add currency' to add new one if you need this
   1. check left radio button to set this currency as base IF ITS REALLY BASIC CURRENCY
   2. enter currency code as described here
   3. select currency sign
   4. select currency sign position
   5. select currency decimals
   6. enter currency rate relative to the base OR press finance agregator button
   7. enter any description text (better do that)
   8. click on empty flag image and select the flag image. Take some free flags here
   9. press 'Save changes'
8. Check left radio button to set any currency as basic (default) - it is very important:
9. Hint: For each currency you can hide cents on the front of your site. By default JPY cents are always hidden!
10. Hint: if you want to update all currencies from the current aggregator for one time - press radio button of the basic currency
11. Hint: if you not found money sign you need you can always add it in the tab Options -> Custom money signs
12. Hint: if you want let your customers pay in their selected currency in tab Advanced set the option Is multiple allowed to Yes.
13. You can set currencies rate by hands, or by with aggregators functionality:
14. No GET data in link - Switches currency without GET properties (?currency=USD) in the link
15. Show money signs - Show/hide money signs on the front drop-down
16. Show price info icon - Show info icon near the price on the front of the product which on hover shows prices of products in all another currencies exept of current one.
17. Welcome currency - In wich currency show prices for first visit of your customer on your site:
18. Currency aggregator - Currency aggregators which allows to get currency rates automatically!
19. Currency storage - sometimes some servers doesn allow keep data in the session on site front for non-logged users. So just set it to transient!
20. Rate auto update - You can set rate auto update for your currencies by wp cron - hourly, twice daily, daily, weekly, monthly.
    Before using this feature - check is current aggregator works fine ->
    by pressing 'finance.aggregator' button. The rate of the currency must be updated with normal value.
    Sometimes for some countries or servers no one aggregator works!
21. Email notice about "Rate auto update" results - After cron done - new currency rates will be sent on the site admin email. ATTENTION: if you not got emails - it is mean that PHP function mail() doesnt work on your server or sending emails by this function is locked.
22. Hide switcher on checkout page - Hide switcher on checkout page for any of your reason. Better restrike for users change currency on checkout page in multiple mode.
23. Payments rules - Hide/Show payment systems on checkout page depending on the current currency
24. Show approx. amount - Show approximate amount on the checkout and the cart page with currency of user defined by IP in the GeoIp rules tab.
25. Show approx. price - Show approximate price on the shop and the single product page with currency of user defined by IP in the GeoIp rules tab. Works only with currencies rates data and NOT with fixed prices rules and geo rules.
26. I am using cache plugin on my site - Set Yes here ONLY if you are REALLY use cache plugin for your site, for example like 'Super cache' or 'Hiper cache' plugins (doesn matter which). + Important: Set "Custom price format", for example: __PRICE__ (__CODE__). After enabling this feature - clean your cache to make it works. It will allow show prices in selected currency on all pages of the site. Fee for this feature: additional AJAX queries for prices redrawing.
27. Show options button on top admin bar. - Show WOOCS options button on top admin bar for quick access. Very handy for active work. Visible for site administrators only!
28. Hint: If you want to use links for different pages with content where currency already pre-selected use link with GET data in it:
    https://demo.currency-switcher.com/?currency=USD
    https://demo.currency-switcher.com/?currency=GBP
29. Custom money signs: Sometimes count of standard currencies symbols is not enough. You can add your own symbol using simple syntax! Look next screen please:
30. Custom price format - if you want to change view of the price on the site front you can use this option. Example: __PRICE__ (__CODE__) - means that first will be price-amount then currency code of it. There is 2 special words for this manipulation:
    - __PRICE__ - price-number
    - __CODE__ - code of the current currency
31. Prices without cents - Recount prices without cents everywhere like in JPY and TWD which by its nature have not cents. Use comma. Example: UAH,RUB. Test it for checkout after set!
32. After installing data in WOOCS Settings next step is widget installation
33. You have 7 aggregators, and after selection of one of them press 'Save changes' button before using it
    Sometimes aggregators fails - in such case just select another one, press save changes button, and try to work with it again!
34. There is 6 currency drop-down skins:
35. There is possible to hide flags by default on site front:
36. There is possible to hide money signs on the site front:

### Tab Advanced

Added in v.2.1.8/1.1.8

1. If you want let your customers pay with their selected currency - you should set multiple mode to 'Yes':
2. Individual fixed prices rules for each product - You will be able to set FIXED prices for simple and variable products. ATTENTION: 'Is multiple allowed' should be enabled!
3. Checkout by GeoIP rules - Force the customers to pay on checkout page by rules defined in 'GeoIP rules' tab. ATTENTION: this feature has logical sense if you enabled 'Enable fixed pricing' and also installed fixed prices rules in the products for different currencies!
4. Individual GeoIP rules for each product - You will be able to set different prices for each product (in BASIC currency) for different countries
5. Video: Individual GeoIP rules AND Individual fixed prices
6. Statistic - Collect currencies switching statistic for business purposes. No any private data of customers collects, only currency, country and time of switching. Also statistic for order currencies is there.

### Tab GeoIP rules

From WooCommerce version 2.3.0 it is possible to define from which country is your customer from by IP.
This usefull functionality is using by the plugin to show your site customers currency which you decided to show them in their firts visit.
Here is all simple: add countries to the currencies using drop-down. And that is all. For example as on the screen: USD -> selected United States -> this means that for all customers from USA will be set USD on their first vistit to your site.

If you have troubles with this feature read this article please.

### Side Switcher

This tab functionality allows you to set currency switcher as static block on the right or left side of the site page.
There is 3 skins you can use:

- Classic blocks:

- Roll blocks (width for transition should be set):

- Round select:

#### Next options:

- Enable/Disable - enabling or disabling the functionality
- Skin - style of the switcher on the site front(3)
- Side - the side where the switcher is be placed
- Top margin - distance from the top of the screen to the switcher html block. You can set in px or in %. Example 1: 100px. Example 2: 10%.
- Main color - main color which coloring the switcher elements
- Hover color - the switcher color when mouse hovering
- Basic field(s) - what content to show in the switcher after the site page loading. Variants: __CODE__ __FLAG___ __SIGN__ __DESCR__
- Hover field(s) - what content to show in the switcher after mouse hover on any currency there. Variants: __CODE__ __FLAG___ __SIGN__ __DESCR__
- Show on the pages - where on the site the switcher should be visible. If any value is presented here switcher will be hidden on all another pages which not presented in this field. You can use pages IDs using comma, example: 28,34,232. Also you can use special words as:
  - product - switcher will be shown only on the single products pages
  - shop - show switcher on the shop page
  - checkout - show switcher on the checkout page
  - front_page - show switcher on the front page page
  - woocommerce - show switcher on the pages which has relation to woocommerce. On all simple pages and posts the switcher will be hidden.
- Hide on the pages - where on the site the switcher should be hidden. If any value is presented here switcher will be hidden on that pages and visible on all another ones. You can use pages IDs using comma, example: 28,34,232. Also you can use special words as:
  - product - switcher will be hidden only on the single products pages
  - shop - hide switcher on the shop page
  - checkout - hide switcher on the checkout page
  - front_page - hide switcher on the front page page
  - woocommerce - hide switcher on the pages which has relation to woocommerce
- Behavior for devices - you can:
  - Show on all devices - (by default) show switcher on all devices
  - Show on mobile devices only - switcher will be shown on mobile devices and hidden on PC
  - Hide on mobile devices - switcher will be hidden on mobile devices and visible on all another ones

### Tab Statistic

To make it visible in tab Advanced Options enable switcher 'Statistic'. Statistic allows collect information about currency switching and about currencies used in shop orders.

### Widget installation

1. Go to the widgets pages
2. Find 'WooCommerce Currency Switcher' widget and drop it any sidebar you want
3. Enter any title in the widget or leave it empty
4. Enter width of currencies drop-down in such manners: 300px, 100%
5. Check 'Show flags' if you need this
6. Select flag position IF switcher skin is ddslick
7. Drop-down options text type - set what you want to show on the front: currency code and its sign, OR its description from the plugin options.

#### The plugin has 2 additional widgets:

- WooCommerce Currency Rates - allows you show to your customers your site currency rates relatively to the current selected currency on the front!
  - exclude - which currencies to hide
  - precision - decimals (digits after comma)
- WooCommerce Currency Converter - shortcode which allows your customers convert different amounts from one currency to another by AJAX!
  - exclude - which currencies to hide
  - precision - decimals (digits after comma)

### Shortcode installation

The plugin has shortcode which you can drop anywhere:
[woocs style=1 show_flags=1 width='300px' flag_position='right' txt_type='desc']

1. show_flags - show flags: 1 or 0
2. width - width. Set it like:300px,150px,75%,100%
3. flag_position - flag position. You can set left or right (for ddslick skin only)
4. txt_type - 2 values: desc and code. desc - on the front will be shown currency description in the drop-down options. code - will be shown currency code and its sign.
5. style - added in version 2.2.9 for new styles system. Set there value from 1 to 3 (depends of in-built count of styles)
6. Styles: #2, #3 has its own targeted options:
   - Style #2: head_bg - color of head background, head_txt_color - head text, head_close_bg - bg color of cross button, head_close_color - color of cross in close button. Example: [woocs style="2" head_bg="#ff0000" head_txt_color="#000" head_close_bg="green" head_close_color="yellow"]
   - Style #3: head_title - Text of head title, leave it empty to hide. Example: [woocs style="3" head_title=""]

If you want to set switcher in your wp theme header.php or footer.php use next code:

                    <?php echo do_shortcode('[woocs]'); ?>

#### The plugin has some additioanal shortcodes:

- [woocs_rates exclude="GBP,AUD" precision=2] - shortcode allows you to show your customers your site currency rates!
  - exclude - which currencies to hide
  - precision - decimals (digits after comma)
- [woocs_converter exclude="GBP,AUD" precision=2] - shortcode which allows to your customers convert different amount from one currency to another by AJAX!
  - exclude - which currencies to hide
  - precision - decimals (digits after comma)
- [woocs_get_sign_rate sign=UAH] - allows you to show rate of any currency installed in the attribute 'sign' relationaly to your basic currency.
- [woocs_show_current_currency text="" currency="" flag=1 code=1]
  - text - any text before
  - currency - currency code
  - flag - show/hide flag on front - 1/0
  - code - show/hide code on front - 1/0
- [woocs_show_custom_price value=20] - value should be in the default currency. Good for any marketing text in any txt-banners or in the content editor to show price in the selected currency

### Order backend

!!Visible only if multiple mode is activated!!

Recalculate order - The plugin provides functionality to recount order to values IN the basic currency. This feature is useful for woo statistic which doesn work in multiple mode and cant operate wit amounts in different currencies. BUT it's recommended test this feature with clone of the site which can be created for 10 minutes by this plugin on your localhost. This will avoid any issues related with software incompatibility!

On page orders you can find button "Recalculate all orders" which allows recalculate all orders to basic currency in one click

Change order currency - In some cases users need ability to create orders by hands. In such case they have to select currency of order.
Just look on the screens below to understand how to to that:

USE IT ONLY WHEN YOU CREATING NEW ORDER BY HANDS

### Front

Depends of the plugin settings you can show your currencies drop-down as:
ddslik:
chosen:
wSelect:
simply drop-down:
as flag images:
Style #1:
Style #2:
Style #3:
Simple drop-down has CSS class woocommerce-currency-switcher which you can use in your customization if you need it.

### Additional

- If you want to get a rate of any currency relative to the basic currency use next shortcode: [woocs_get_sign_rate sign=EUR]
- From version 1.0.6 you can use flags images on the front of your site for currency switching:
  If you want to customize it for your front, you can use next CSS code for it:

                                  a.woocs_flag_view_item{
                                      display: inline-block;
                                      margin: 0 3px 3px 0;
                                      width: 50px;
                                      height: 40px;
                                  }
                                  a.woocs_flag_view_item img{
                                      width: 100%;
                                  }

                                  a.woocs_flag_view_item_current{
                                      opacity: 0.65;
                                  }

- In some cases developers need to get value from meta value, but what if that value is equal to basic currency?! So lets recount it!! Use next hook for it:
  $val = apply_filters('woocs_exchange_value', $val); - that is all!
  Example of such case is: https://currency-switcher.com/manufacturer-price/
- If it is necessary to reset WOOCS currency options to default, apply next link: /wp-admin/admin.php?page=wc-settings&tab=woocs&woocs_reset=1

### Video

### HOOKS

1. woocs_price_format - any manipulations with price format
   Example:

                                   add_filter('woocs_price_format', 'my_woocs_custom_format', 999, 2);
                                   function my_woocs_custom_format($format, $currency_pos)
                                   {
                                       return 'ANY_STRING_HERE ' . $format . ' OR_HERE';
                                   }

   1 - $format (string)
   2 - $currency position (string)
2. woocs_currency_data_manipulation - If you need manipulate with currency rate, for example with rate of any currency on the fly
   Example:

                                   add_filter('woocs_currency_data_manipulation', 'my_woocs_currency_data_manipulation');

                                   function my_woocs_currency_data_manipulation($currencies)
                                   {
                                       foreach ($currencies as $key => $value)
                                       {
                                           if($key == 'GBP'){
                                               $currencies[$key]['rate']=$value['rate']+0.025;
                                               break;
                                           }
                                       }

                                       return $currencies;
                                   }

   1 - $currencies (array)
   Its possible to change on the fly next currency data:

       'name','rate','symbol','position','description','hide_cents','flag'

   Do it by your own logic and be attentive!
3. woocs_exchange_value - Convert value. For example some plugins get values of the products directly from its meta value without woocommerce hooks, in such case currency switching doesn work. Its just an example, but in this case it is possible use next wordpress filter
   Example:

                                   $value = apply_filters('woocs_exchange_value', $value);

   1 - $value (float)
   Useful for fixing incompatibility in some plugin as this example
4. woocs_currency_symbols - Add more currency symbols into woo-shop
   Example:

                                   add_filter('woocs_currency_symbols', 'my_woocs_currency_symbols', 999);
                                   function my_woocs_currency_symbols($symbols)
                                   {
                                       $symbols[]="Ă";
                                       return $symbols;
                                   }

   1 - $symbols (array)
   This can be realized with the plugin settings: tab Options -> 'Custom money signs'
5. woocs_drop_down_view - possible to change drop-down skin on different pages of the site if its necessary
   Possible values: no,ddslick,chosen,chosen_dark,wselect,flags
   Example:

                                   add_filter('woocs_drop_down_view', 'my_woocs_drop_down_view', 1);
                                   function my_woocs_drop_down_view($default_view)
                                   {
                                       if ($_SERVER['REQUEST_URI'] == '/shop/clothing/happy-ninja-2/')
                                           {
                                               $default_view = 'chosen';
                                           }
                                       return $default_view;
                                   }

   1 - $default_view (string)
   Use `$_SERVER['REQUEST_URI']` because function `is_page()` doesn work there.
   This feature is presented in: tab Options -> 'Drop-down view'
6. woocs_price_format - possible to change price format. Presented in index.php -> `public function woocommerce_price_format()`
7. woocs_price_html_tail - use this to add any info blocks after price html
   Example:

                                   add_filter('woocs_price_html_tail', 'my_woocs_price_html_tail', 999);
                                   function my_woocs_price_html_tail($price_html)
                                   {
                                       if (defined('DOING_AJAX') && DOING_AJAX)
                                           {
                                               $price_html.="Hello World 2016!!";
                                           }
                                       return $price_html;
                                   }

   1 - $price_html (string)
   Combinate it with CSS (in style.css) code if its necessary

                                   .woocs_price_html_tail{
                                       display: none;
                                   }

                                   body.single-product .woocs_price_html_tail{
                                       display: block;
                                   }

                                   body.single-product .related .woocs_price_html_tail{
                                       display: none;
                                   }

8. woocs_get_approximate_amount_text - works if option 'Show approx. amount' is enabled and replaces word "Approx." to any you want!
   Example:

                                   add_filter('woocs_get_approximate_amount_text', 'my_woocs_get_approximate_amount_text', 999);
                                   function my_woocs_get_approximate_amount_text($approx_word, $wc_price)
                                   {
                                       return sprintf(__('(MY-Approx-any-word. %s)'), $wc_price);
                                   }

   1 - $approx_word (string)
   2 - $wc_price (string)

### API

Here is described some plugin functionality which can be useful for site development.

- Get current currency:

                                  global $WOOCS;
                                  echo $WOOCS->current_currency;

- Get currencies list:

                                  global $WOOCS;
                                  $currencies=$WOOCS->get_currencies();
                                  print_r($currencies['EUR']);
                                  print_r($currencies[$WOOCS->current_currency]);

                             $currencies array has next structure:

                                 array(
                                      'USD' => array(
                                          'name' => 'USD',
                                          'rate' => 1,
                                          'symbol' => '$',
                                          'position' => 'right',
                                          'is_etalon' => 1,
                                          'description' => 'USA dollar',
                                          'hide_cents' => 0,
                                          'flag' => '',
                                      ),
                                      'EUR' => array(
                                          'name' => 'EUR',
                                          'rate' => 0.89,
                                          'symbol' => '€',
                                          'position' => 'left_space',
                                          'is_etalon' => 0,
                                          'description' => 'Europian Euro',
                                          'hide_cents' => 0,
                                          'flag' => '',
                                      )
                                  );

- Convert value:
  For example some plugins get values of the products directly from its meta value, and currency changing doesn works. Its just an example, but in this case it is possible use next wordpress filter:

                                  $value = apply_filters('woocs_exchange_value', $value);

  The same is possible to make by another code:

                                  global $WOOCS;
                                  $currencies = $WOOCS->get_currencies();
                                  $value = $value * $currencies[$WOOCS->current_currency]['rate'];
                                  $value = number_format($value, 2, $WOOCS->decimal_sep, '');
                                  echo $value;

- Change currency to any another ('USD' as example):

                                  global $WOOCS;
                                  $WOOCS->current_currency='USD';
                                  $WOOCS->storage->set_val('woocs_current_currency', 'USD');

- Manipulate with the currency switcher drop-down skins when its necessary, with any logic conditions, for example set usual drop-down skin for site in mobile view:

                                  add_filter('woocs_drop_down_view', 'woocs_drop_down_view', 999);

      			    function woocs_drop_down_view($view)
      			    {

      				if (wp_is_mobile())
      				{
      				       return 'no';
      				}

      				return $view;
      			    }

- REST API. WOOCS supports it and has in-built request: wp-json/woocs/v3/currency - where you can get all data about shop currency. Another requests can be created also in functions.php using action rest_api_init - but all them should start as: wp-json/woocs/
- Look for more hooks, functions, hints here: WOOCS CODEX