Skip to content

Instantly share code, notes, and snippets.

@plugin-republic
Created June 12, 2024 10:42
Show Gist options
  • Save plugin-republic/510c7e01c696de380e7f9dba5947d255 to your computer and use it in GitHub Desktop.
Save plugin-republic/510c7e01c696de380e7f9dba5947d255 to your computer and use it in GitHub Desktop.
<?php
/**
* Apply the standard booking cost as a fixed cost to a booking, regardless of how long the booking is
*/
function prefix_fixed_booking_cost( $booking_cost, $product_id ) {
$product = wc_get_product( $product_id );
$booking_cost = floatval( bfwc_get_standard_cost( $product ) );
return $booking_cost;
}
add_filter( 'bfwc_booking_cost', 'prefix_fixed_booking_cost', 10, 2 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment