WordPress filter hook
woocommerce_currency
Defined by WooCommerce and fired by 15 plugins in total, running on 7.1M+ sites between them.
“Add support for showing all point types in the WooCommerce currency dropdown. If this is a currency store, we need to switch the currency code.”
How to use woocommerce_currency
It's a filter: your callback receives the value, and must return the (changed) value.
Add this to your theme's functions.php or a small custom plugin:
add_filter( 'woocommerce_currency', function( $value ) {
// Change $value here.
return $value;
}, 10, 1 );Argument names come from Wallet for WooCommerce's source. Other plugins may pass different values: check the call in the plugin you're targeting below.
15 plugins that fire woocommerce_currency
Sorted by active installs. Each entry shows where the plugin calls the hook and what it passes.
-
WooCommerce7+ million installs
apply_filters( 'woocommerce_currency', get_option( 'woocommerce_currency' ) )includes/wc-core-functions.php:496 -
Booster for WooCommerce30,000+ installs
apply_filters( 'woocommerce_currency', get_option( 'woocommerce_currency' ) )includes/class-wcj-multicurrency.php:1144 -
Wallet for WooCommerce20,000+ installs
apply_filters( 'woocommerce_currency', $this->get_base_currency() )includes/multicurrency/class-woo-wallet-abstract-currency-provider.php:44 -
Points Management System For Gamification, Ranks, Badges, and Loyalty Rewards Program10,000+ installs
apply_filters( 'woocommerce_currency', get_option( 'woocommerce_currency', false ) )includes/mycred-install.php:143 -
Saphali Woocommerce Lite10,000+ installs
apply_filters( 'woocommerce_currency', get_option('woocommerce_currency') )saphali-woocommerce-lite.php:971 -
Freesoul Deactivate Plugins8,000+ installs
apply_filters( 'woocommerce_currency', get_option( 'woocommerce_currency' ) )inc/fdp-woocommerce.php:198 -
Travelly1,000+ installs
apply_filters( 'woocommerce_currency', get_option('woocommerce_currency', 'USD') )inc/TTBM_Currency_Fallback.php:18 -
Gulf currencies Symbols for WooCommerce1,000+ installs
apply_filters( 'woocommerce_currency', get_woocommerce_currency() )saudi-riyal-symbol-for-woocommerce.php:137 -
Cryptocurrency Payment Gateway300+ installs
apply_filters( 'woocommerce_currency', $currency )cryptocurrency-payment-gateway.php:1313 -
BX Essentials20+ installs
apply_filters( 'woocommerce_currency', get_option('woocommerce_currency', 'BRL') )includes/classes/Plugin-Resources.php:167 -
DataQlick10+ installs
apply_filters( 'woocommerce_currency', get_option( 'woocommerce_currency' ) )inc/class.export-shop.php:18 -
ShopyBot10+ installs
apply_filters( 'woocommerce_currency', get_option('woocommerce_currency') )includes/class-wc-shopybot-export.php:936 -
First Party AnalyticsFewer than 10 installs
apply_filters( 'woocommerce_currency', get_option( 'woocommerce_currency' ) )src/class-utils.php:248 -
Umba Payment Gateway Free for WooCommerceFewer than 10 installs
apply_filters( 'woocommerce_currency', get_option( 'woocommerce_currency' ) )includes/umba-hooks.php:405 -
PureMetrixFewer than 10 installs
apply_filters( 'woocommerce_currency', 'EUR' )includes/class-woocommerce.php:63
Need a customisation built on this hook?
Tell us what you want to change and which plugin it's for. We'll write it, test it and send it back as a small plugin.