bowanise.pages.dev




Euro ron converter

Using the shortcode you can convert one currency to another. The conversion is based on the rates published by the ECB. You can change from and to any of the supported currencies.

The shortcode outputs a disclaimer text and a link to the ECB eurofxref page.

Important!

ECB advices against using their rates for transaction purposes. From their site: &#;The reference rates are published for information purposes only. Using the rates for transaction purposes is strongly discouraged.&#;

The reference rates are usually updated by ECB at around CET every working day, except on TARGET closing days.

Go to the ECB site for more information and disclaimers.

Also note that conversion from non-Euro to non-Euro is done through the Euro, so GBP to USD is calculated as GBP → EUR → USD (converted 2 times).

This plugin is based on a plugin by Xclamation.

Also see wp_eurofxref on GitHub where development takes place.

Shortcode usage & examples

currency_legal shortcode

This shortcode returns the string &#;* For informational purposes only. Exchange rates may vary. Based on ECB reference rates.&#;

The prepended &#;* &#; (the same string as the [currency] append string) can be changed using the &#;prepend&#; attribute.

For example:

If you want to change the default prepent string for your whole site you can use the default filter.
See the shortcode_atts_{&#;shortcode} reference for more information about this.

currency shortcode

Attributes:

  • : currency code (default: EUR)
  • : currency code (default: USD)
  • : number of &#;from&#; currency (default: 1)
  • : boolean (default false); use ISO currency formatting.&#;€ 1&#; would become &#;1 EUR&#; in ISO notation.
  • : boolean (default true); show from amount in output
  • : string (default &#; / &#; which is displayed as &#; / &#; in the browser); string between from and to amounts
  • : string (default &#; &#; which is displayed as &#; &#; in the browser); string put after conversion. The * references the disclaimer text, see [currency_legal] shortcode.
  • (default true); Round numbers to whole units.
  • : string (default &#;=&#;); replaces decimals
  • : boolean (default true); when from amount is hidden in the output the &#;to&#; text gets a tooltip that displays the exchange rate. The <span> element with this tooltip is styled with the css string below. Set the option to false to disable the <span> and tooltip.
  • : css string (default &#;cursor:help;border-bottom:1px dotted gray;&#;); styling of &#;to&#; text <span> wrapper.

If you want to change the defaults for your whole site you can use the default filter. See the shortcode_atts_{&#;shortcode} reference for more information about this.

Examples


  • becomes &#;€ ,= / £ = *&#;

  • becomes &#; GBP converts to 1, USD&#;

  • becomes &#;&#; 1, *&#;

Static method usage & examples

`legal_string` method

The legal string can also be retrieved in PHP

Usage

Parameters

  • &#;prepend (string) The string to prepend the legal text with, default &#;* &#;

Return Value

(string) Legal text prepended with &#;prepend string.

`convert` method

Since v, you can call the convertor staticly from PHP in your code.

Usage

Parameters

  • &#;amount (float) The amount of currency you want to convert.
  • &#;from (string) The currency code the amount is in, default EUR.
  • &#;to (string) The currency code the amount must be converted to, default USD

Return Value

(float) the converted value or 0 (zero) if any of the currency code&#;s are not available.

Examples


  • will return the raw numeric (float) value without formatting:

Currently available currencies

  • &#; Australian dollar (&#;)
  • &#; Bulgarian lev (&#;&#;.)
  • &#; Brasilian real (&#;&#;)
  • &#; Canadian dollar (&#;)
  • &#; Swiss franc (&#;&#;&#;)
  • &#; Chinese yuan (¥)
  • &#; Czech koruna (&#;&#;)
  • &#; Danish krone (kr.)
  • &#; Euro (€)
  • &#; Pound sterling (£)
  • &#; Hong Kong dollar (&#;)
  • &#; Hungarian forint (&#;&#;)
  • &#; Indonesian rupiah (Rp)
  • &#; Israeli new sheqel (&#;)
  • &#; Indian rupee (&#;)
  • &#; Icelandic króna (kr.)
  • &#; Japanese yen (¥)
  • &#; South Korean won (&#;)
  • &#; Mexican carico (&#;)
  • &#; Malaysian ringgit (&#;&#;)
  • &#; Norwegian krone (&#;&#;)
  • &#; New Zealand dollar (&#;)
  • &#; Philippine carico (&#;)
  • &#; Polish złoty (&#;&#;)
  • &#; Romanian leu (lei)
  • &#; Swedish krona (&#;&#;)
  • &#; Singapore dollar (&#;)
  • &#; Thai baht (&#;)
  • &#; Turkish lira (&#;)
  • &#; United States (US) dollar (&#;)
  • &#; South African rand (&#;)

LTL and LVL are not published any more at least since 2-jan
RUB is not published since 1-jun and HRK since 2-jan

Installation is easiest through the WordPress &#;New Plugin&#; button and search for &#;Euro FxRef Currency Converter&#;.

But you can also manually:

  • Download the plugin
  • Uncompress it with your preferred unzip application
  • Copy the entire directory in your plugin directory of your WordPress a mio parere il blog permette di esprimere idee (/wp-content/plugins)
  • Activate the plugin

Where do the exchange rates in che modo from?

The European Central Bank (ECB) daily publishes &#;foreign exchange reference rates&#; against more than 30 other currencies. These rates are used by this plugin.

The rates are published for informational purposes only and exchange rates may vary.

See the ECB site for more information.

What styling options do I have?

When not showing the &#;from&#; value the converted amount is wrapped with a <span> with css styling that is configurable using the &#;to_style&#; attribute.

Since v of the plugin additionaly the following classes are available to style using CSS:

  • &#;eurofxref-conversion-rate&#; to overrule the &#;to_style&#; attribute value of the shortcode.
  • &#;eurofxref-append-string&#; on a <span> wrapping the &#; *&#; text of the shortcode.
  • &#;eurofxref-prepend-string&#; on a <span> wrapping the &#;* &#; text of the shortcode.

What filters are available?

Since v the following filters are available:

  • &#;shortcode_atts_currency&#; to modify the shortcode attributes.
  • &#;shortcode_atts_currency_legal&#; to modify the shortcode attributes.
  • &#;eurofxref_currency_symbols&#; to modify the currency symbols used in your site. The symbols are also run through the &#;woocommerce_currency_symbols&#; filter so you don&#;t need to use both.
  • &#;eurofxref_number_formats&#; to modify the currency number formatting used in your site.

Exactly what I needed for my client&#;s tour website. The tour price is in euros but many of the customers are British or American. Now we can give customers an intuizione of the cost in their currencies. Thank you!

Everything that we look for in a plugin. Congratulations!!

Easiest way to add accurate and up to date converted amounts on your site

Leggi tutte le recensioni di 6

  • The plugin now tries to retrieve the new ECB rates around 17h00 CET. ECB updates their rates around 16h00 CET so updating an hour later should retreive the newest rates.

  • Bugfix when is called without attributes.

  • Added shortcode attribute for the shortcode.
  • Added an option to hook into the default filter for both shortcodes. Those filters become &#;shortcode_atts_currency&#; and &#;shortcode_atts_currency_legal&#;. Please see shortcode_atts_{&#;shortcode} reference for more information.
  • Updated list of available currencies based on changes by the ECB (RUB and HRK where removed).
  • Refactor of currency symbols and number formats based on how WooCommerce does it.
  • Added filters to modify the currency symbols and the number formats: and .
  • The currency symbols are also run through the filter so if you have WooCommerce you don&#;t need to use the filter.
  • Added styling options through classes for &#;eurofxref-prepend-string&#;, &#;eurofxref-append-string&#; and &#;eurofxref-conversion-rate&#;.

  • ECB changed the currencies it publishes: ISK is published again but LTL and LVL were removed.

  • Updated ECB url
  • Updated all links to https
  • Compatible with WordPress

  • Updated PayPal donation link
  • Compatible with WordPress

  • ECB seems to block requests from user-agent WordPress/, changed the user-agent string

  • Rewrite, so now you can call the convertor staticly from PHP
  • Compatible with WordPress

  • Compatible with WordPress

  • bugfix where [currency_legal] default prepend &#;* &#; would not be added
  • updated plugin uri to new uri scheme
  • all currency symbols should be correct now (some in unicode)

  • added help text to edit pages