1. Documentation /
  2. Multi-Currency for WooCommerce /
  3. Multi-currency: Shortcodes

Multi-currency: Shortcodes

WooCommerce Multi-currency is an extension that provides switching currencies and re-calculating rates on-the-fly.

This document describes advanced multi-currency settings. The initial setup and configuration can be found on this page.

What are WordPress shortcodes?

↑ Back to top

Shortcodes in WordPress are code shortcuts that help you add dynamic content in WordPress posts, pages, and sidebar widgets. They are displayed inside square brackets like this:

[myshortcode]

https://www.wpbeginner.com/wp-tutorials/how-to-add-a-shortcode-in-wordpress/


Currency Switcher shortcode

↑ Back to top

To embed the Currency Switcher in a page or post, you can use the woocommerce-currency-switcher shortcode.

Standard dropdown

↑ Back to top

[woocommerce-currency-switcher format="{{code}}: {{name}} ({{symbol}})"]

The placeholders in curly brackets are used to fine-tune the display format. Below you can see the formatting examples:

  • Note: “selector” is now replaced with the new one, named “switcher”. Parameters are the same.
WooCommerce Multi-currency - shortcode

Currency Switcher with country flags

↑ Back to top

To show flags in the switcher, add flag=1 parameter to the shortcode:

[woocommerce-currency-switcher format="{{code}}: {{name}} ({{symbol}})" flag=1]

Note: you may need to add CSS rules to match the switcher with flags to your WordPress theme.

Currency Converter shortcode

↑ Back to top

The woomc-convert shortcode can be used to display prices converted to a specific currency. Below you can see some usage examples:

SETTINGS
Base currency:CAD
Active currency:USD
SHORTCODEOUTPUT
With no arguments, shortcode will output zero:
[woomc-convert]
$0.00
Use value=”1″ to display the rate:
[woomc-convert value="1" decimals="4"]
$0.7980
Convert $5 from base (CAD) to the active (USD) currency:
[woomc-convert value="5"]
$3.99
Display just the converted value, without the currency sign:
[woomc-convert value="5" formatting="false"]
3.99
“off” and “false” are the same:
[woomc-convert value="5" formatting="off"]
3.99
Convert $5 to a specific currency (not the active one):
[woomc-convert value="5" currency="EUR"]
€3.32
Override the number of decimals for the currency (JPY has no decimals by default):
[woomc-convert value="5" currency="JPY" decimals=1]
¥432.7
Display value in the base currency (CAD):
[woomc-convert value="5" currency="DEFAULT"]
C$5.00

Currency Switcher in a menu

↑ Back to top

Using shortcode (since version 2.11.0)

↑ Back to top
  • Note: “selector” is now replaced with the new one, named “switcher”.
  • IMPORTANT:
    • Do not change the #woomc-shortcode URL
    • Be very accurate when changing the shortcode in the “Description” field. If you miss a quote or a bracket, the output will be broken.

Using hard-coded URLs (legacy method)

↑ Back to top

You can create a hard-coded currency switcher using Custom Links:

Please remember to update the menu items when you add or remove currencies.