WordPress Currency Switcher

# WordPress Currency Switcher v.2.1.8

## Marketing tool - WordPress Currency Switcher

The Plugin Demo page Buy the Plugin

- Created: 11-08-2016 (dd-mm-yy)
- Latest update: 08-07-2022 (dd-mm-yy)
- By: realmag777
- Site: www.pluginus.net
- Support: on codecanyon

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

### Step-by-step backend

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: wp-admin/options-general.php?page=currency-switcher-settings
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' button to add new currency if you need it
   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. enter currency rate relative to the base OR press finance.yahoo button
   6. select show or hide cents on the front for this currency
   7. enter any description text (better do that)
   8. click on empty flag image and set flag image. Take free flags here
   9. press 'Save chages'
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. You can set currencies rates as by hands so by aggregators:
12. Currency storage - sometimes some servers doesn allow keep data in the session on thes site front for non-logged users. So just set it to transient!
13. You have some aggregators, and after select one of them press 'Save changes' before using this
    Sometimes aggregators are fails - in such case just select another one, press save changes, and try to work with currencies rates again!
14. You have some of currency drop-down skins:
15. You can hide flags in the drop-down of the currency switcher
16. You can hide money signs in the drop-down of the currency switcher
17. Show price info icon - Show info icon near the price on the front, which on hover shows prices of products in all another currencies (except current currency)
18. Sometimes there are cases when you have basic prices in one currency but you want to show for new visitors (for first unique their visit) of the site prices in another currency. For such cases you can use 'Welcome currency':
19. 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://mysite.com/page1/?currency=EUR
    http://mysite.com/page2/?currency=GBP
20. 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 working fine
    by pressing 'finance.aggregator' button the rate of the currency should be updated with normal value.
    Sometimes for some countries or servers no one aggregator doesnt works because of different strange cases!
21. 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.
22. Sometimes count of standard currencies symbols is not enough. You can add your own symbol using simple syntax! Look next screen please:
23. 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-amount
    - __CODE__ - currency code of the current currency
24. Tab GeoIP rules - here you can set rules and your site users will see prices in currency of their country in the FIRST visit on the site. Of course customers of the site will be able to change the currency as they want.
25. After installing the plugin settings - next step is the widget installation

### Tab 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: home, front_page
- 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: home, front_page
- 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

### Widget installation

1. Go to the widgets pages
2. Find 'WordPress 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 the currencies drop-down in such manners: 300px OR 100%
5. Check/Uncheck 'Show flags' if you need it
6. Select flags (for ddslick skin only)
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:

- WordPress 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)
- WordPress 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:
[wpcs 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 from the currency description. code - will be shown currency code and its sign.

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

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

#### The plugin has some additioanal shortcodes:

- [wpcs_price value=20] - main shortcode, always use this if you want to display any price OR amount in the content of your site. value == price, or any amount by your logic
  Also its possible to show converted value from any meta field using in the shortcode attribute 'meta_value'. Example: [wpcs_price meta_value=any_meta_field_key]
  - value - price, amount or any by your logic. Decimal or integer.
  - meta_value - price amount taken directly from a meta field, this field has more priority than attribute 'value' if they presented together in the shortcode. Decimal or integer.
  - type - only one value for this attribute 'fixed'. Uses for FIXED prices - prices which shows for each currency without recounting relatively of basic currency. Examples:
    - [wpcs_price type="fixed" value="USD:15,EUR:20,GBP:45"]
    - [wpcs_price meta_value=my_price_field type="fixed"] - value in the metafield should be like USD:15,EUR:20,GBP:45
    If you will miss value for any currency on the site front will be displayed word 'none'.
- [wpcs_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)
- [wpcs_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)
- [wpcs_code_rate sign=USD] - allows you to show rate of any currency installed in the attribute 'sign' relationaly to your basic currency.
- [wpcs_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
- [wpcs_check_country] - displays current country information, just for info

### Front

Depends of the plugin settings you can show your currencies drop-down as:
ddslik:
chosen:
wSelect:
simple drop-down:
as flag images:
Simple drop-down has css class 'currency-switcher' which you can use in your customizations if you need it.

### Video