Created
June 12, 2024 10:42
-
-
Save plugin-republic/510c7e01c696de380e7f9dba5947d255 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
<?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