Home Contact Us Payments SC Commerce SC Commerce Docs SC Commerce Snippets

Simply Computing

We make websites. Simple.

Add a custom currency and currency symbol

If your preferred currency is not included with SC Commerce you can easily add it (and a custom currency symbol) using this code.

 * Add a custom currency and currency symbol

// Adds a custom currency and associated symbol if not already included with Classic Commerce 
// https://docs.woocommerce.com/document/add-a-custom-currency-symbol/

add_filter('woocommerce_currencies', 'scc_woo_add_my_currency');
function scc_woo_add_my_currency($currencies) {
  $currencies['ABC'] = __('New Currency Name', 'woocommerce');
  return $currencies;
add_filter('woocommerce_currency_symbol', 'scc_woo_add_my_currency_symbol', 10, 2);
function scc_woo_add_my_currency_symbol($currency_symbol, $currency) {
  switch($currency) {
    case 'ABC': $currency_symbol = '#'; break;
    return $currency_symbol;
   View Raw Code ID: 91553