Last active
April 18, 2024 08:10
-
-
Save woogists/326d883e678ac8d15e3dbfef84ca1389 to your computer and use it in GitHub Desktop.
Change a currency symbol
This file contains 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 a currency symbol | |
*/ | |
add_filter('woocommerce_currency_symbol', 'change_existing_currency_symbol', 10, 2); | |
function change_existing_currency_symbol( $currency_symbol, $currency ) { | |
switch( $currency ) { | |
case 'AUD': $currency_symbol = 'AUD$'; break; | |
} | |
return $currency_symbol; | |
} |
රු
Try this:
/**
- Change a currency symbol
*/
add_filter('woocommerce_currency_symbol', 'change_existing_currency_symbol', 10, 2);
function change_existing_currency_symbol( $currency_symbol, $currency ) {
switch( $currency ) {
case 'LKR': $currency_symbol = 'Rs'; break;
}
return $currency_symbol;
}
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
/**
*/
add_filter('woocommerce_currency_symbol', 'change_existing_currency_symbol', 10, 2);
function change_existing_currency_symbol( $currency_symbol, $currency ) {
switch( $currency ) {
case 'QAR': $currency_symbol = 'QAR'; break;
}
return $currency_symbol;
}