Viewing 4 replies - 1 through 4 (of 4 total)
  • You could use the em_get_currencies filter to add a new currency. For example if you wanted to add the Ukrainian Hryvna you could use the following code snippet:

    add_filter('em_get_currencies', function( $currencies ) {
        $currencies->names['UKR'] = 'UKR - Ukraine Hryvna';
        $currencies->symbols['UKR'] = '₴';
        $currencies->true_symbols['UKR'] = '₴";
    } );

    You can use the Code Snippets plugin to add this code snippet.

    You can see the existing supported currencies in the file wp-content/plugins/events-manager/em-functions.php in the function em_get_currencies.

    Thread Starter stemoven

    (@stemoven)

    Thank you! I tried adding through Code Snippets, but it didn’t work, the currencies drop-down was blank. But I managed to edit the php file and made it work. I just wonder if it will be overwritten every time there’s an update?

    Yes, it will be overwritten every time there’s an update. Here’s a corrected version of the code snippet:

    add_filter('em_get_currencies', function( $currencies ) {
        $currencies->names['UKR'] = 'UKR - Ukraine Hryvna';
        $currencies->symbols['UKR'] = '&#8372';
        $currencies->true_symbols['UKR'] = '₴';
        return $currencies;
    } );
    Thread Starter stemoven

    (@stemoven)

    Many thanks, it worked!

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘Where to add custom currency?’ is closed to new replies.