Created
February 2, 2015 14:49
-
-
Save woogist/d62d09a4a8d339c18256 to your computer and use it in GitHub Desktop.
Hides the cost for free checkout add-ons
This file contains hidden or 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
/** | |
* 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