Skip to content

Instantly share code, notes, and snippets.

@chrdesigner
Last active August 29, 2015 14:22
Show Gist options
  • Select an option

  • Save chrdesigner/72ae700872738fac0da3 to your computer and use it in GitHub Desktop.

Select an option

Save chrdesigner/72ae700872738fac0da3 to your computer and use it in GitHub Desktop.
Add symbol United Arab Emirates Dirham
<?php
// Add symbol United Arab Emirates Dirham
add_filter( 'woocommerce_currencies', 'add_custom_currency' );
function add_custom_currency( $currencies ) {
$currencies['AED'] = __( 'United Arab Emirates Dirham', 'woocommerce' );
return $currencies;
}
add_filter('woocommerce_currency_symbol', 'add_custom_currency_symbol', 10, 2);
function add_custom_currency_symbol( $currency_symbol, $currency ) {
switch( $currency ) {
case 'AED': $currency_symbol = 'AED '; break;
}
return $currency_symbol;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment