Woocommerce : Add a custom currency or symbol

Woocommerce : Add a custom currency or symbol 1.0

Please Login to download
  • Thanks for visiting us!
Add this code to your child theme’s functions.php

PHP:
/**
* 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;
}
Author
ibrahim
Downloads
0
Views
314
First release
Last update
Rating
0.00 star(s) 0 ratings