Skip to content

Instantly share code, notes, and snippets.

@pippinsplugins
Last active September 10, 2017 10:20
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save pippinsplugins/8653114 to your computer and use it in GitHub Desktop.
Save pippinsplugins/8653114 to your computer and use it in GitHub Desktop.
Show $0.00 prices as "Free" in EDD.
<?php
/* Plugin Name: Custom Functions */
function pw_format_currency( $formatted, $currency, $price ) {
if( ! is_admin() && $price == 0.00 ) {
return 'Free';
}
return $formatted;
}
add_filter( 'edd_usd_currency_filter_before', 'pw_format_currency', 10, 3 );
@SeanTOSCD
Copy link

When this code is used, it appears that all other prices that are not 0.00 disappear from the site. Do you have a tweak for this? We have a user trying to use this code. Thanks!

Edit: https://easydigitaldownloads.com/support/topic/show-0-00-prices-as-free-in-edd/

Copy link

ghost commented Sep 30, 2014

Thanks

@zeromajstor
Copy link

How to hide automatically prices that are 0.00$ ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment