Created
January 24, 2018 17:09
-
-
Save mtruitt/1fb7bacb4fda7548280d05aaa289e6b1 to your computer and use it in GitHub Desktop.
Change Price filter - Change texted or price based on conditions
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
<?php | |
function change_price($price) { | |
if ( $price == wc_price( 0 ) ) | |
return 'FREE'; | |
elseif ( $price == '' ) { | |
return 'Coming Soon'; | |
} else { | |
return $price; | |
} | |
} | |
add_filter('woocommerce_get_price_html', 'change_price', 10, 2); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment