Skip to content

Instantly share code, notes, and snippets.

@woogist
Created February 2, 2015 14:49
Show Gist options
  • Save woogist/d62d09a4a8d339c18256 to your computer and use it in GitHub Desktop.
Save woogist/d62d09a4a8d339c18256 to your computer and use it in GitHub Desktop.
Hides the cost for free checkout add-ons
/**
* Hides the cost for free checkout add-ons
*
* @param string $html
* @param object $fee
* @return string
*/
function wc_hide_fee_cost( $html, $fee ) {
$hide_for = array(
'add-on-slug',
// Add here as many add-ons as you need
);
if ( in_array( $fee, $hide_for ) ) {
$html = '';
}
return $html;
}
add_filter( 'woocommerce_cart_totals_fee_html', 'wc_hide_fee_cost', 10, 2 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment