Skip to content

Instantly share code, notes, and snippets.

@levantoan
Last active October 17, 2015 05:15
Show Gist options
  • Save levantoan/dee7d56a9548d180c96e to your computer and use it in GitHub Desktop.
Save levantoan/dee7d56a9548d180c96e to your computer and use it in GitHub Desktop.
Hides the 'Free!' price notice woocomerce
<?php
//Remove (Free) label on cart page for "Shipping and Handling" if cost is $0
function sv_change_cart_shipping_free_label( $label ) {
$label = str_replace( "(Free)", " ", $label );
return $label;
}
add_filter( 'woocommerce_cart_shipping_method_full_label' , 'sv_change_cart_shipping_free_label' );
<?php
/**
* Hides the 'Free!' price notice
*/
add_filter( 'woocommerce_variable_free_price_html', 'hide_free_price_notice' );
add_filter( 'woocommerce_free_price_html', 'hide_free_price_notice' );
add_filter( 'woocommerce_variation_free_price_html', 'hide_free_price_notice' );
function hide_free_price_notice( $price ) {
return '';
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment