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:

functions.php
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.

  1. WooCommerce icon WooCommerce7+ million installs apply_filters( 'woocommerce_currency', get_option( 'woocommerce_currency' ) ) includes/wc-core-functions.php:496
  2. Booster for WooCommerce icon Booster for WooCommerce30,000+ installs apply_filters( 'woocommerce_currency', get_option( 'woocommerce_currency' ) ) includes/class-wcj-multicurrency.php:1144
  3. Wallet for WooCommerce icon Wallet for WooCommerce20,000+ installs apply_filters( 'woocommerce_currency', $this->get_base_currency() ) includes/multicurrency/class-woo-wallet-abstract-currency-provider.php:44
  4. Points Management System For Gamification, Ranks, Badges, and Loyalty Rewards Program icon 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
  5. Saphali Woocommerce Lite icon Saphali Woocommerce Lite10,000+ installs apply_filters( 'woocommerce_currency', get_option('woocommerce_currency') ) saphali-woocommerce-lite.php:971
  6. Freesoul Deactivate Plugins icon Freesoul Deactivate Plugins8,000+ installs apply_filters( 'woocommerce_currency', get_option( 'woocommerce_currency' ) ) inc/fdp-woocommerce.php:198
  7. Travelly icon Travelly1,000+ installs apply_filters( 'woocommerce_currency', get_option('woocommerce_currency', 'USD') ) inc/TTBM_Currency_Fallback.php:18
  8. Gulf currencies Symbols for WooCommerce icon Gulf currencies Symbols for WooCommerce1,000+ installs apply_filters( 'woocommerce_currency', get_woocommerce_currency() ) saudi-riyal-symbol-for-woocommerce.php:137
  9. Cryptocurrency Payment Gateway icon Cryptocurrency Payment Gateway300+ installs apply_filters( 'woocommerce_currency', $currency ) cryptocurrency-payment-gateway.php:1313
  10. BX Essentials icon BX Essentials20+ installs apply_filters( 'woocommerce_currency', get_option('woocommerce_currency', 'BRL') ) includes/classes/Plugin-Resources.php:167
  11. DataQlick icon DataQlick10+ installs apply_filters( 'woocommerce_currency', get_option( 'woocommerce_currency' ) ) inc/class.export-shop.php:18
  12. ShopyBot icon ShopyBot10+ installs apply_filters( 'woocommerce_currency', get_option('woocommerce_currency') ) includes/class-wc-shopybot-export.php:936
  13. First Party Analytics icon First Party AnalyticsFewer than 10 installs apply_filters( 'woocommerce_currency', get_option( 'woocommerce_currency' ) ) src/class-utils.php:248
  14. Umba Payment Gateway Free for WooCommerce icon Umba Payment Gateway Free for WooCommerceFewer than 10 installs apply_filters( 'woocommerce_currency', get_option( 'woocommerce_currency' ) ) includes/umba-hooks.php:405
  15. PureMetrix icon 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.