woocommerce currencies

https://woocommerce.com/products/woocommerce-custom-currencies/

add_filter( 'woocommerce_currencies', 'add_my_currency' );
  
function add_my_currency( $currencies ) {
     $currencies['HKD'] = __( '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 'HKD': $currency_symbol = 'HK$'; break;
     }
     return $currency_symbol;
}

Leave a Reply