Skip to content

Instantly share code, notes, and snippets.

@claudiosanches
Created January 25, 2016 23:05
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 claudiosanches/a17d93fc7caf7a4c5cf7 to your computer and use it in GitHub Desktop.
Save claudiosanches/a17d93fc7caf7a4c5cf7 to your computer and use it in GitHub Desktop.
WooCommerce - Add Saudi Riyal currency and symbol
<?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 ? '&#x631;.&#x633;' : $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