Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Change a currency symbol
/**
* 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;
}
@imranh654

This comment has been minimized.

Copy link

imranh654 commented Mar 15, 2020

this does not work for me can anyone please check?

add_filter('woocommerce_currency_symbol', 'change_existing_currency_symbol', 10, 2);

function change_existing_currency_symbol( $currency_symbol, $currency ) {
switch( $currency ) {
case 'د.ك': $currency_symbol = 'KD'; break;
}
return $currency_symbol;
}

@inside83

This comment has been minimized.

Copy link

inside83 commented Mar 22, 2020

It totally works, just used it.
Maybe try switching because I doubt this 'د.ك' is an international currency symbol.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.