Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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 );
@SDavisMedia
Copy link

SDavisMedia commented Sep 27, 2014

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

zeromajstor commented Sep 10, 2017

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