Skip to content

Instantly share code, notes, and snippets.

@stuartduff
Last active December 15, 2022 16:09
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/3d1f9effaa80754d8a7a4136fa0352fa to your computer and use it in GitHub Desktop.
Save stuartduff/3d1f9effaa80754d8a7a4136fa0352fa to your computer and use it in GitHub Desktop.
Remove the word From: before WooCommerce Bookings Price [Temp Fix #3459]
/**
* Temp Fix for the Bookings issue below.
* #3459
*/
function temp_price_fix_bookings( $price, $product ) {
$target_product_types = array(
'booking'
);
if ( in_array ( $product->product_type, $target_product_types ) ) {
// if bookable product remove From: before price
return wc_price( $product->get_price() );
}
// return normal price
return $price;
}
add_filter('woocommerce_get_price_html', 'temp_price_fix_bookings', 10, 2);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment