Skip to content

Instantly share code, notes, and snippets.

@LiamBailey
Created December 11, 2017 16:01
Show Gist options
  • Save LiamBailey/a49c5287d43657603a629fee9b48beb2 to your computer and use it in GitHub Desktop.
Save LiamBailey/a49c5287d43657603a629fee9b48beb2 to your computer and use it in GitHub Desktop.
<?php
add_filter( 'woocommerce_bookings_in_date_range_query', 'wswp_filter_check_in_cart', 100, 1);
function wswp_filter_check_in_cart( $booking_ids ) {
foreach( $booking_ids as $key => $booking_id ) {
$booking = get_wc_booking( $booking_id );
if ( $booking->has_status( 'in-cart' ) ) {
unset( $booking_ids[$key] );
}
}
return $booking_ids;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment