Skip to content

Instantly share code, notes, and snippets.

@mtruitt
Created January 24, 2018 17:09
Show Gist options
  • Save mtruitt/1fb7bacb4fda7548280d05aaa289e6b1 to your computer and use it in GitHub Desktop.
Save mtruitt/1fb7bacb4fda7548280d05aaa289e6b1 to your computer and use it in GitHub Desktop.
Change Price filter - Change texted or price based on conditions
<?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