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
Watch video How to Hide Product Price Only If the Price is Set to 0 / Zero in WooCommerce WordPress online without registration, duration hours minute second in high quality. This video was added by user WebTask With Hassan 04 June 2023, don't forget to share it with your friends and acquaintances, it has been viewed on our site 313 once and liked it 4 people.