Created
April 22, 2022 07:58
-
-
Save bradleysa/c8f099408d417da58cb538e452f19414 to your computer and use it in GitHub Desktop.
WC: Disable WooCommerce From: $$ Price
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
function patricks_custom_variation_price( $price, $product ) { | |
$target_product_types = array( | |
'variable' | |
); | |
if ( in_array ( $product->product_type, $target_product_types ) ) { | |
// if variable product return and empty string | |
return ''; | |
} | |
// return normal price | |
return $price; | |
} | |
add_filter('woocommerce_get_price_html', 'patricks_custom_variation_price', 10, 2); | |
/** http://speakinginbytes.com/2013/11/disable-from-price/ **/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment