Skip to content

Instantly share code, notes, and snippets.

@woogists
Last active July 7, 2024 14:50
Show Gist options
  • Save woogists/72947b71e48a62f15f5548283d4ed00f to your computer and use it in GitHub Desktop.
Save woogists/72947b71e48a62f15f5548283d4ed00f to your computer and use it in GitHub Desktop.
Add a custom currency / symbol
/**
* 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;
}
@AndySharez
Copy link

AndySharez commented May 12, 2024

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.

uns curr

And for country I tried my own country,
but also created custom country (world) as well.

Problem still prevalent.

@AndySharez
Copy link

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.

uns curr

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