/** | |
* 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; | |
} |
not work for me its like geo currency in need to change BD or BHD instead of د.ب
how to add multiple currency not just one?
not work for me its like geo currency in need to change BD or BHD instead of د.ب
Did you solve the problem? i have the same issue. i want to replace د.ج with DZD
Hi there, hope you´re doing great!
Well...I´ve recently updated to woo 6.5.1, the code above dosn´t work anymore.
Is it posible that some class has been modified?
Best regards!
Please Use this snippet in your site
by using plugin
code snippet
add_filter('woocommerce_currency_symbol', 'my_custom_currency_symbol', 10, 2) ;
function my_custom_currency_symbol( $currency_symbol, $currency ) {
switch( $currency ) {
case 'BHD': $currency_symbol = 'BHD';
break;
}
return $currency_symbol;
}
not work for me its like geo currency in need to change BD or BHD instead of د.ب
Did you solve the problem? i have the same issue. i want to replace د.ج with DZD
Please Use this snippet in your site change to your currency code BHD
by using plugin
code snippet
add_filter('woocommerce_currency_symbol', 'my_custom_currency_symbol', 10, 2) ;
function my_custom_currency_symbol( $currency_symbol, $currency ) {
switch( $currency ) {
case 'BHD': $currency_symbol = 'BHD';
break;
}
return $currency_symbol;
}
Took me a while to make it works. For those who may want to know.
After you added the snippet. You have to enable the custom currency from Woocommerce Settings - > Currency options.
Thank you, it works :D