Add these snippets to your child theme’s functions.php file or use a plugin like Code snippets. Don’t add code directly to the parent theme’s functions.php file as it will be overridden by updates. Customize the texts/values in red to whatever you need.
Share availability between products
Requires Easy Booking PRO >= 1.1.7
add_filter( 'easy_booking_share_product_availability', 'wceb_share_availability', 10, 2 );
function wceb_share_availability( $shared_ids, $_product_id ) {
$shared = array( '1', '2', '3' );
if ( in_array( $_product_id, $shared ) ) {
return $shared;
}
return $shared_ids;
}
Change unavailability period depending on product or variation
add_filter( 'easy_booking_product_unavailability_period', 'wceb_unavailability_period', 10, 3 );
function wceb_unavailability_period( $unavailability_period, $_product_id, $parent_id ) {
if ( $_product_id == 'ID' ) {
$unavailability_period = 2;
}
return $unavailability_period;
}