Skip to content

Instantly share code, notes, and snippets.

@thanh4890
Forked from mikejolley/gist:1565309
Created February 23, 2013 16:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save thanh4890/5020315 to your computer and use it in GitHub Desktop.
Save thanh4890/5020315 to your computer and use it in GitHub Desktop.
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;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment