WooCommerce Currency Switcher v.2.1.8

Flexible WooCommerce Currency Switcher


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: I just bought the plugin and cant install it. Error!!

  1. At the end we have to get something like this on the plugin settings page:
    backend
  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.yahoo 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:
    backend
  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. You can set currencies rate by hands, or by with aggregators functionality:
    backend
  12. ---
  13. 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!
  14. You have 3 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!
  15. There is 6 currency drop-down skins:
    backend
  16. There is possible to hide flags by default on site front:
    backend
  17. There is possible to hide money signs on the site front:
    backend
  18. 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.
  19. Sometimes there are cases when you have prices in one currency but want to show new visitors prices in another currency. For such cases you should use 'Welcome currency':
    backend
  20. Hint: If you want to use links for different pages with content where currency already pre-selected use link with GET data in it:
    http://demo.currency-switcher.com/?currency=USD
    http://demo.currency-switcher.com/?currency=GBP
  21. Rate auto update - You can set rate auto update for your currencies by wp cron - hourly, twice daily, daily, weekly, monthly.
    backend
    Before using this feature - check is current aggregator works fine -> backend 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!
  22. 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.
  23. 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.
  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.
    Show approx. amoun
  25. 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.
  26. Sometimes count of standard currencies symbols is not enough. You can add your own symbol using simple syntax! Look next screen please:
    backend
  27. 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
  28. 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!
  29. After installing data in WOOCS Settings next step is widget installation

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':
    backend
  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

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. backend
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.

  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.
    • code
    • desc

The plugin has 2 additional widgets:

The plugin has shortcode which you can drop anywhere:
[woocs 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.
    • code
    • desc

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:

!!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!
order


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
order
order
order
order

Depends of the plugin settings you can show your currencies drop-down as:

ddslik:
front
chosen:
front
wSelect:
front
simply drop-down:
front
as flag images:
front

Simple drop-down has CSS class woocommerce-currency-switcher which you can use in your customization if you need it.

  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)

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