Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
[WooCommerce Ninja Forms Product Add-ons] Hide price add-ons equal to zero
/*
* Snippet to hide price add-ons equal to zero.
* Code goes in the functions.php file in your theme.
*/
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
You can’t perform that action at this time.