Support

Home Forums Event Espresso Premium Customize display of currency_symbol

Customize display of currency_symbol

Posted: July 10, 2013 at 12:16 pm

Viewing 3 reply threads


Runemester

July 10, 2013 at 12:16 pm

Is there a way to customize the way the currency is displayed without editing core files? I previously managed by editing organization_config. But I’m really not happy about too much fiddling with core files. I’m in the progress of doing an overhaul, update and testing on a demo-install before updating the production site where the plugin has been running (and doing a great job btw) for the past year http://www.esrum.dk/arrangementsoversigt (production site)

In my case it’s Danish Krone. By default prices are displayed as krxxx.xx (ie. no space between the symbol/abbreviation and the amount). In my particular case I would like to display the price as kr. xxx.xx (which is an accepted standard in Denmark) and I can’t seem to find any way to accomplish this without editing organization_config.

Any thoughts?

Thanks
Rune


Josh

  • Support Staff

July 10, 2013 at 4:05 pm

Hi Rune,

One way to do this without changing a core function would be to do a find and replace on all the templates that display price.

Or you could filter the content with a function like this:

function my_change_ee_kr( $content ) {

	global $org_options;

	$content = str_replace( $org_options['currency_symbol'], 'kr. ', $content);

	return $content;

}

add_filter( 'the_content', 'my_change_ee_kr', 11 );

The problem with this though is it will change any content on the page that has the string kr in it. So it’s kind of hacky.

I mentioned this to the dev team and we’re thinking the way forward on this one will be adding a “label” setting for currency display on the front end for future versions.


Runemester

July 11, 2013 at 2:37 am

Thanks Josh,

I was working along that line. But as you mention it´s kind of hacky. For the time being I’ll settle with organization_config as it requires a minimum of change (albeit to a core file). Great to know that you’ve passed it along to the devs and the outlined solution would be a useful addition to the plugin.

Cheers
Rune


Josh

  • Support Staff

July 11, 2013 at 9:48 am

Thanks for the feedback Rune. I added a ticket to the feature idea list.

Viewing 3 reply threads

The support post ‘Customize display of currency_symbol’ is closed to new replies.

Have a question about this support post? Create a new support post in our support forums and include a link to this existing support post so we can help you.

Event Espresso