Skip to content

Instantly share code, notes, and snippets.

@plugin-republic
Created February 18, 2026 08:30
Show Gist options
  • Select an option

  • Save plugin-republic/be9d0af445644c8a205a45b0c7be555f to your computer and use it in GitHub Desktop.

Select an option

Save plugin-republic/be9d0af445644c8a205a45b0c7be555f to your computer and use it in GitHub Desktop.
<?php
/**
* Subtract last day's cost from daily booking
* Requires bookings to be a minimum of 2 days
*/
function demo_dont_charge_last_day( $booking_cost, $product_id ) {
$std_cost = bfwc_get_standard_cost( $product_id );
$booking_cost = $booking_cost - $std_cost;
return $booking_cost;
}
add_filter( 'bfwc_booking_cost', 'demo_dont_charge_last_day', 10, 2 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment