Thread Starter
Joys66
(@joys66)
Hi!
Of course, the UAH currency was added via this filter.
But the problem is that if the currency is not in this list
case "GBP" :
case "BRL" :
case "EUR" :
case "USD" :
case "AUD" :
case "CAD" :
case "HKD" :
case "MXN" :
case "SGD" :
case "JPY" :
will execute the default code.
default :
$formatted = $price . ' ' . $currency;
// 100 UAH not 100 smb
Or am I wrong?
Can you show me the exact filter / callback function you’re using?
You will need to use the edd_currency_symbol
filter to add a new symbol for your currency code that is registered as shown above.
Note: please do not modify the files in the plugin directly. Use add_filter() to make changes, as shown in the documentation I linked above.
Thread Starter
Joys66
(@joys66)
// function.php my theme
function edd_add_my_currency_symbol($symbol,$currency) {
if (!empty($currency) && $currency=='UAH') $symbol=' grn';
return $symbol;
}
function pippin_extra_edd_currencies( $currencies ) {
$currencies['UAH'] = 'Ukrainian hryvnia';
return $currencies;
}
add_filter('edd_currencies', 'pippin_extra_edd_currencies');
add_filter( 'edd_currency_symbol','edd_add_my_currency_symbol',10 ,2 );
Thread Starter
Joys66
(@joys66)
IMHO bug in function edd_currency_filter() formatting.php
line 157 default :
line 158 $formatted = $price . ' ' . $currency;
must be
line 157 default :
line 158 $formatted = $price . ' ' . $symbol;
It’s not that way mainly because of backwards compatibility. Changing it now would have very adverse affects on existing websites.
Which part of the code you posted above is not working as expected?