Skip to content

Instantly share code, notes, and snippets.

@stuartduff
Created April 23, 2021 15:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save stuartduff/2d39168152af7e44d542ff46215f4b87 to your computer and use it in GitHub Desktop.
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
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