Support

Home Forums Event Espresso Premium Changing price label symbol

Changing price label symbol

Posted: October 2, 2014 at 3:30 am

Viewing 8 reply threads


Joshua

October 2, 2014 at 3:30 am

How can I change the price label from ‘EUR’ to ‘€’?


Josh

  • Support Staff

October 2, 2014 at 7:51 am

Hi Joshua,

You add the following to your functions file:


Joshua

October 2, 2014 at 8:00 am

Thanks Josh, that worked perfectly. Is there also a way to change the decimal point to a comma?

€50.00 > €50,00


Josh

  • Support Staff

October 3, 2014 at 2:26 pm

Hi Joshua,

It turns out that you can, using the same basic idea:

function my_change_ee_price_decimal_separator( $content ) {

	$sep = '.00';
 
	$content = str_replace( $sep, ',00', $content );
 
	return $content;
 
}

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


Joshua

October 4, 2014 at 7:02 am

Hi Josh,

Added the code above to the functions.php file in my theme, but nothing seems to change. I’ve double checked and it really in there. Strange 🙂

Do you know why??


Lorenzo Orlando Caum

  • Support Staff

October 4, 2014 at 2:58 pm

Hi,

The sample code provided does work:

http://cl.ly/image/1d2z2D1H1j0V

It looks for pricing that ends in .00 and changes it to ,00.

Are you using pricing different than the example that you provided?


Lorenzo


Joshua

October 5, 2014 at 7:21 am

Okay, so it only works when the price ends with .00

Our prices are ending with .50 so I changed that and it works. But how can I change it to change all prices? Say for example I have a new price set at .95 then it wont work.

Please advise.


Lorenzo Orlando Caum

  • Support Staff

October 5, 2014 at 8:30 pm

function my_change_ee_price_decimal_separator_50( $content ) {
 
  $sep = '.50';
  
  $content = str_replace( $sep, ',50', $content );
  
  return $content;
  
}
 
add_filter( 'the_content', 'my_change_ee_price_decimal_separator_95', 11 );

function my_change_ee_price_decimal_separator_95( $content ) {
 
  $sep = '.95';
  
  $content = str_replace( $sep, ',95', $content );
  
  return $content;
  
}
 
add_filter( 'the_content', 'my_change_ee_price_decimal_separator_95', 11 );


Lorenzo


Joshua

October 8, 2014 at 3:55 am

It’s a shame that there is no default to only change the symbol. Maybe this will updated in a later release. Thanks anyway.

Viewing 8 reply threads

The support post ‘Changing price label 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