Add a custom currency and currency symbol in WooCommerce

/**
 * Adds custom currency.
 */
add_filter( 'woocommerce_currencies', function ( $currencies ) {
	$currencies['ABC'] = esc_html__( 'My currency' );
	return $currencies;
} );

/**
 * Sets custom currency symbol.
 */
add_filter( 'woocommerce_currency_symbol', function ( $currency_symbol, $currency ) {
	switch ( $currency ) {
		case 'ABC':
			$currency_symbol = '$';
			break;
	}
	return $currency_symbol;
}, 10, 2 );

Leave a Comment