Tips / Recommendations

Replacing currency sign with letters Woocommerce

Open the WordPress theme’s functions.php file and add a filter for woocommerce to it (ATTENTION !!! The code below is added to the end of the functions.php file):

add_filter( ‘woocommerce_currencies’, ‘add_my_currency’ );

function add_my_currency( $currencies ) {

$currencies[‘UAH’] = __( ‘Українська гривня’, ‘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 ‘UAH’: $currency_symbol = ‘грн’; break;

}

return $currency_symbol;

}

Leave a Reply

Your email address will not be published. Required fields are marked *

20 − 3 =