Seemed to me that adding a new currency to WooCommerce would be extremely easy and wide spread which turns out is not the case. I couldn’t find any filter in the filter list with the hooks and filters list.
Anyway I managed to find out that there are two filters for this: ‘woocommerce_currencies’ and ‘woocommerce_currency_symbol’. Adding the bulgarian currency for instance is as easy as:
add_filter( 'woocommerce_currencies', 'add_bgn_currency' );
function add_bgn_currency( $currencies ) {
$currencies['BGN'] = __( 'Bulgarian lev', 'woocommerce' );
return $currencies;
}
add_filter('woocommerce_currency_symbol', 'add_bgn_currency_symbol', 10, 2);
function add_bgn_currency_symbol( $currency_symbol, $currency ) {
switch( $currency ) {
case 'BGN': $currency_symbol = 'лв.'; break;
}
return $currency_symbol;
}
Note: All this code can be placed somewhere in your theme’s functions.php
The result is that now the currency is shown in the Currency list:

Anyway one problem still persists – the currency symbol position is totally unmanagable from a hook. It can be only set site-wide through the settings section of WooCommerce. It is also placed in a not-so-intuitive place:

This is how far I’ve got with the multilingual shop with WPML and WooCommerce. Still wondering how to make the symbol position to be currency-specific (and not be afraid to update the plugin afterwards). Maybe I’ll have to make it in JS in the end.
I’ll keep you posted! And follow this guy:
Leave a Reply