Skip to content

Instantly share code, notes, and snippets.

@woogist
Created September 23, 2015 14:31
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 woogist/65dcb3ce250104936ab2 to your computer and use it in GitHub Desktop.
Save woogist/65dcb3ce250104936ab2 to your computer and use it in GitHub Desktop.
Ninja Forms hide addon costs equal to zero
<?php
add_filter( 'wc_nf_addons_format_cart_item_price' , 'wc_ninja_forms_hide_zero_price' );
function wc_ninja_forms_hide_zero_price( $value ) {
$hide_price = ' (' . wc_price( '0.00' ) . ')';
if ( $value == $hide_price ) {
return '';
} else {
return $value;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment