Last active
December 2, 2023 19:00
-
-
Save softiconic/060084a8bf52ee9d356acbfbee9d68bf to your computer and use it in GitHub Desktop.
Alter the currency display in WooCommerce.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Change currency display in WooCommerce | |
* Put this in your functions.php file | |
*/ | |
function softiconic_currency_symbol( $currency_symbol, $currency ) { | |
switch( $currency ) { | |
case 'USD': | |
$currency_symbol = 'USD $'; | |
break; | |
case 'CAD': | |
$currency_symbol = 'CAD $'; | |
break; | |
} | |
return $currency_symbol; | |
} | |
add_filter('woocommerce_currency_symbol', 'softiconic_currency_symbol', 30, 2); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment