Created
January 25, 2016 23:05
-
-
Save claudiosanches/a17d93fc7caf7a4c5cf7 to your computer and use it in GitHub Desktop.
WooCommerce - Add Saudi Riyal currency and symbol
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
<?php | |
function wc_add_saudi_riyal_currency( $currencies ) { | |
$currencies['SAR'] = 'Saudi Riyal'; | |
return $currencies; | |
} | |
add_filter( 'woocommerce_currencies', 'wc_add_saudi_riyal_currency' ); | |
function wc_add_saudi_riyal_symbol( $symbol, $currency ) { | |
return 'SAR' === $currency ? 'ر.س' : $symbol; | |
} | |
add_filter( 'woocommerce_currency_symbol', 'wc_add_saudi_riyal_symbol', 10, 2 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment