Currency add Korean won

Hello? I want to add Korean Won to the default currency, so I followed the page below.

However, no matter how much I modify the code, the example rupee is entered properly, but the Korean Won is not added.
Is there an error in the code below? If I just add the code, the site will error and I will not be able to access it.

add_filter( 'gform_currencies', 'add_krw_currency' );
function add_krw_currency( $currencies ) {
	$currencies['KRW'] = array(
		'name'               => __( 'Korean won', 'gravityforms' ),
		'code'               => 'KRW',
		'symbol_left'        => '',
		'symbol_right'       => '',
		'symbol_padding'     => ' ',
		'thousand_separator' => ',',
		'decimal_separator'  => '.',
		'decimals'           => 0,
	);

	return $currencies;
}

Hi Jisim,

To add the Korean won currency, please try the following modified code. You can add this code to the child theme’s functions.php file or use the Code Snippets plugin.

add_filter( 'gform_currencies', 'add_krw_currency' );

function add_krw_currency( $currencies ) {
    $currencies['KRW'] = array(
        'name'               => __( 'Korean Won', 'gravityforms' ),
        'code'               => 'KRW',
        'symbol_left'        => '₩',
        'symbol_right'       => '',
        'symbol_padding'     => ' ',
        'thousand_separator' => ',',
        'decimal_separator'  => '.',
        'decimals'           => 0
    );
  
    return $currencies;
}

I’ve tested the code and it’s working like the following screenshot.

Give it a try, and let me know how that goes!

Thank you so much. I put in the code you gave me and it works fine. Thank you so much.

1 Like

You’re welcome. I’m glad to see it’s working now.