Created
April 23, 2021 15:12
-
-
Save stuartduff/2d39168152af7e44d542ff46215f4b87 to your computer and use it in GitHub Desktop.
This code snippet will remove the word From: in the WooCommerce Bookings price display
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 custom_booking_product_price( $price, $product ) { | |
$target_product_types = array( | |
'booking' | |
); | |
if ( in_array ( $product->product_type, $target_product_types ) ) { | |
$price = str_replace("From:", "", $price); | |
return $price; | |
} | |
// return normal price | |
return $price; | |
} | |
add_filter('woocommerce_get_price_html', 'custom_booking_product_price', 10, 2); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment