Support

Home Forums Event Espresso Premium Change FREE php to Complimentary

Change FREE php to Complimentary

Posted: December 4, 2018 at 7:41 am


globaldisciples

December 4, 2018 at 7:41 am

I created my plugin to turn 0.00 to say free. Can I make it say Complimentary instead? What do I change in the code below?

function convert_zero_to_free( $amount, $return_raw ) {

if ( ! $return_raw || ! is_admin() ) {

$amount = $amount == 0 ? __( ‘free’, ‘event_espresso’ ) : $amount;

}
return $amount;
}
add_filter( ‘FHEE__EEH_Template__format_currency__amount’, ‘convert_zero_to_free’, 10, 2 );

Source: https://eventespresso.com/wiki/show-ticket-price-zero-free/


Tony

  • Support Staff

December 4, 2018 at 9:07 am

Hi there,

Changing
__( ‘free’, ‘event_espresso’ )

to be
__( 'complementary', 'event_espresso' )

in the above should do what you are requesting.

You must be logged in to reply to this support post. Sign In or Register for an Account

Support forum for Event Espresso 3 and Event Espresso 4.
Documentation for EE3 and EE4
Documentation for Event Espresso 3

Documentation for Event Espresso 4

Status: publish

Updated by  Tony 1 week, 1 day ago ago

Topic Tags

Notifications

This topic is: not resolved
Do NOT follow this link or you will be banned from the site!