Create a Ninja Form
↑ Revenir en hautCreating a New Form
↑ Revenir en hautCreate a Product
↑ Revenir en hautUsage
↑ Revenir en hautCustomization
↑ Revenir en hautNote: This is a Developer level section. If you are unfamiliar with code and resolving potential conflicts, select a WooExpert or Developer for assistance. We are unable to provide support for customizations under our Support Policy.
Hide price add-ons equal to zero
↑ Revenir en haut
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* 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; | |
} | |
} |
Hide all sub-prices
↑ Revenir en haut
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Snippet to hide all sub prices | |
* Code goes in the functions.php file in your theme. | |
*/ | |
add_filter( 'wc_nf_addons_cart_option', 'wc_ninja_forms_price' ); | |
function wc_ninja_forms_price( $display ) { | |
return ''; | |
} |