Skip to content

Instantly share code, notes, and snippets.

@nerrad
Last active August 29, 2015 13:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nerrad/9644575 to your computer and use it in GitHub Desktop.
Save nerrad/9644575 to your computer and use it in GitHub Desktop.
Usage of FHEE__EEH_Template__format_currency__amount filter to return free instead of 0.00 for free tickets
<?php
function convert_zero_to_free( $amount, $return_raw ) {
// we don't want to mess with requests for unformated values because those may get used in calculations
return $return_raw || $amount >= 0 ? $amount : __('free', 'event_espresso');
}
add_filter( 'FHEE__EEH_Template__format_currency__amount', 'convert_zero_to_free', 10, 2 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment