Created
April 23, 2014 15:11
-
-
Save ivandoric/11219283 to your computer and use it in GitHub Desktop.
woocommerce: Add new currency to WooCommerce
This file contains hidden or 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
<?php | |
// Just add it to functions.php | |
// Add currency / symbol | |
add_filter( 'woocommerce_currencies', 'add_rand_currency' ); | |
add_filter( 'woocommerce_currency_symbol', 'add_rand_currency_symbol' ); | |
function add_rand_currency( $currencies ) { | |
$currencies['HRK'] = __( 'Hrvatska kuna (Kn)', 'woothemes' ); | |
return $currencies; | |
} | |
function add_rand_currency_symbol( $symbol ) { | |
$currency = get_option( 'woocommerce_currency' ); | |
switch( $currency ) { | |
case 'HRK': $symbol = 'Kn'; break; | |
} | |
return $symbol; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment