Get all products(Bookable Products) with duration type “Day”
-
Hello,
I’m facing issue in fetching products(bookable products) with duration unit day.
$available_blocks = $booking_form->product->get_available_blocks( array( 'blocks' => $blocks_in_range, 'from' => $from, 'to' => $to)); foreach ( $available_blocks as $check ) { if ( true === $booking_form->product->check_availability_rules_against_date( $check, '' )){ //Custom Added to fetch only blocks in selected range if( $from >= reset($available_blocks) && $to <= end($available_blocks)){ $matches[] = $post_id; break; // check passed } }
I’m using the above code to fetch products, It’s working when the Date & Time is passed in the this format: 2019-08-27 10:00 – 2019-08-27 10:00, When the date fomat is like: 2019-08-27 10:00 – 2019-08-27 14:00, it’s not displaying the products which have duration unit “DAY”.
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘Get all products(Bookable Products) with duration type “Day”’ is closed to new replies.