In this woocommerce tutorial for beginners you will learn how to remove product price if we set price = equal to 0.00 / $0.00 using custom php snippet in wordpress website.
* Use below custom code to hide price.
function wtwh_change_product_price_display( $price ) {
$clear = trim(preg_replace('/ +/', ' ', preg_replace('/[^A-Za-z0-9 ]/', ' ', urldecode(html_entity_decode(strip_tags($price))))));
if($clear == "0 00"){
return '';
}
return $price;
}
add_filter( 'woocommerce_get_price_html', 'wtwh_change_product_price_display' );
add_filter( 'woocommerce_cart_item_price', 'wtwh_change_product_price_display' );
#woocommerce #price #product #wordpress #wordpresstutorial #webtaskwithhassan #hassangilani