Last active
July 7, 2024 14:50
-
-
Save woogists/72947b71e48a62f15f5548283d4ed00f to your computer and use it in GitHub Desktop.
Add a custom 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
/** | |
* Custom currency and currency symbol | |
*/ | |
add_filter( 'woocommerce_currencies', 'add_my_currency' ); | |
function add_my_currency( $currencies ) { | |
$currencies['ABC'] = __( 'Currency name', 'woocommerce' ); | |
return $currencies; | |
} | |
add_filter('woocommerce_currency_symbol', 'add_my_currency_symbol', 10, 2); | |
function add_my_currency_symbol( $currency_symbol, $currency ) { | |
switch( $currency ) { | |
case 'ABC': $currency_symbol = '$'; break; | |
} | |
return $currency_symbol; | |
} |
Hi Please use code snippet plugin to add this code. https://wordpress.org/plugins/code-snippets/
Hello, I have done so; selected 'Run everywhere'.
But the problem is still the same; same orange alert at top of dashboard page.
And for country I tried my own country, but also created custom country (world) as well.
Problem still prevalent.
Hey guys, does anyone have a solution for "Unsupported Currency" in woocommerce?!
I mean, it can't be there is no solution for it, can it?
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hello, I have done so; selected 'Run everywhere'.
But the problem is still the same; same orange alert at top of dashboard page.
And for country I tried my own country,
but also created custom country (world) as well.
Problem still prevalent.