Skip to content

Instantly share code, notes, and snippets.

@vishalbasnet23
Forked from LiamBailey/stop_checking_cart.php
Created December 11, 2017 16:54
Show Gist options
  • Save vishalbasnet23/f1fc33651c0b5a5cbd644b493375faf3 to your computer and use it in GitHub Desktop.
Save vishalbasnet23/f1fc33651c0b5a5cbd644b493375faf3 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