Support

Home Forums Event Espresso Premium remove the currency symbol

remove the currency symbol

Posted: July 28, 2015 at 7:52 am

Viewing 17 reply threads


sergio Pannella

July 28, 2015 at 7:52 am

How can I remove the currency symbol from the Add Event and Registration page . Because we have different currencies for our events . I have the Topic 1 year ago but had the last update , the currencies are back.

thanks

Sergio Pannella


Tony

  • Support Staff

July 28, 2015 at 9:54 am

Hi Sergio,

Can you link us to one of you event so we can see where the currency symbol is displayed please?

In your previous thread Josh provided a function to remove the currency which could be placed within a Site Specific Plugin, is that still in use?


sergio Pannella

July 29, 2015 at 2:05 am

Hello Tony
the link: http://www.pov-int.eu/termine/?ee=612
as I already explained , we have various events with three currencies , Germany , USA and Switzerland , so we need the currency symbol off and write in the description .


sergio Pannella

July 29, 2015 at 2:36 am

…1 year ago I found the solution in “organization_config.php”
line 117 “…default: $org_options[‘currency_symbol’] = ”;” where I have the default symbol deleted , but after the new update , this solution does not work anymore.


Lorenzo Orlando Caum

  • Support Staff

July 29, 2015 at 8:20 am

Hi Sergio, we don’t recommend editing the core plugin so we would like to explore if there is another way to handle this.

Where specifically on the page are you wanting to remove the currency symbol?

Is it in the pricing dropdown menu where two are shown there?


Lorenzo


sergio Pannella

July 29, 2015 at 8:37 am

Hallo Lorenzo, because we have different events in three countries . should the default currency symbol “US Dollars” disappear. by event display and event registration.


Josh

  • Support Staff

July 29, 2015 at 1:20 pm

Hi Sergio,

The reason the currency came back after the update is because you hacked a core file. When you hack a core file, your changes will get overwritten on an update. Instead of hacking the core files, you can add a little function to a custom snippets plugin

function my_change_ee_currency( $content ) {
 
  $content = str_replace( '$', '', $content);
 
  return $content;
 
}
 
add_filter( 'the_content', 'my_change_ee_currency', 11 );


sergio Pannella

July 30, 2015 at 2:34 am

Hi Josh, thanks for your help , I installed the custom snippets plugin , but does not work

Link to the event:http://www.pov-int.eu/termine/?ee=894
Path to plugin:/pov-int.eu/wp-content/plugins/my_change_ee_currency
code:<?php
/*
Plugin Name: Site plugin for pov-int.eu
Description: Site specific code for pov-int.eu
*/
/* Begin Adding Functions Below This Line; Do not include an opening PHP tag as this sample code already includes one! */

/* Stop Adding Functions */

function my_change_ee_currency( $content ) {

$content = str_replace( ‘$’, ”, $content);

return $content;

}

add_filter( ‘the_content’, ‘my_change_ee_currency’, 11 );


sergio Pannella

July 30, 2015 at 2:43 am

… and I have tried again,after the update, with the solution “organization_config.php/
line 117 “…default: $org_options[‘currency_symbol’] = ”;” where I have the default symbol deleted” , this solution does not work anymore.


Dean

July 30, 2015 at 3:03 am

Try this

function my_change_ee_currency() {

	$ee_opt = get_option('events_organization_settings');

	if( $ee_opt['currency_symbol'] != '' ) {
		$ee_opt['currency_symbol'] = '';
	}

	update_option( 'events_organization_settings', $ee_opt );

}
add_filter( 'admin_init', 'my_change_ee_currency' );

It changes the Currency code in the options if the code is not set to blank.

Please note, this fires on EVERY admin page! You need to either tweak the code to make it not do that or only activate this code when you need it (e.g. if you update your Organization settings, it will revert to a currency.


sergio Pannella

July 30, 2015 at 4:27 am

I forgot to write this small detail (?>) in the code. WordPress could not activate plugin. But now works .
many thanks.
Pannella


Dean

July 30, 2015 at 4:37 am

Glad you got it sorted!


sergio Pannella

July 30, 2015 at 5:42 am

Sorry Dean , but is now another problem :
Warning: session_start() [function.session-start]: Cannot send session cache limiter – headers already sent (output started at /kunden/151223_80995/rp-hosting/49/55/pov-int.eu/wp-content/plugins/my_change_ee_currency/my_change_ee_currency.php:21) in /kunden/151223_80995/rp-hosting/49/55/pov-int.eu/wp-content/plugins/event-espresso/espresso.php on line 55


Tony

  • Support Staff

July 30, 2015 at 5:54 am

Hi Sergio,

Your now likely getting that error because you have whitespace after the closing PHP tag you added above.

You don’t really want to close the PHP tags as it is really easy to cause this issue if you do.

Check for whitespace after the closing tag (spaces, return lines, anything), you’ll need to remove anything after it. I would also recommend removing the closing PHP tag from the end of the file, it should not be needed.


sergio Pannella

July 30, 2015 at 6:08 am

Thanks again! finally it is working!


Tony

  • Support Staff

July 30, 2015 at 6:12 am

Great! I’m glad its working for you.

As Dean mentioned if you are using that code within a Site Specific Plugin you would be best de-activating the plugin so it does not run on every page, it only needs to be activated once (then de-activated again) if you edit Event Espresso -> General Settings.


sergio Pannella

July 30, 2015 at 6:47 am

I have made.
thanks


Tony

  • Support Staff

July 30, 2015 at 7:13 am

You’re welcome 🙂

I’ll mark this thread resolved, have a great day.

Viewing 17 reply threads

The support post ‘remove the 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