Last active
December 21, 2016 15:00
-
-
Save nikolab/3ba7505ea6ed0330aba83a077df4a7b0 to your computer and use it in GitHub Desktop.
Make your own currency
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
add_filter( 'woocommerce_currencies', 'add_my_currency' ); | |
function add_my_currency( $currencies ) { | |
$currencies['RSD'] = __( '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 'RSD': $currency_symbol = 'din'; break; | |
} | |
return $currency_symbol; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment