• Resolved Twiks Media

    (@thijmens)


    Hi there!

    I want add a custom code to my website for some extra functions. I search for the option to get the booking date of the booked event. The $EM_Booking->timestamp; gives the actual time en date, so what is the right array to get the booking date?

    Thanks!

    Thijmen

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Support angelo_nwl

    (@angelo_nwl)

    Hi,

    You can try something like $EM_Booking->booking_date – for more information, you can check events-manager/classes/em-booking.php

    Thread Starter Twiks Media

    (@thijmens)

    Hi Angelo,

    Thanks for your respons. When i use $EM_Booking->booking_date in a foreach i get ‘NULL’ as output.

    I use the code:

    foreach ($EM_Bookings as $EM_Booking) {
    							
    $EM_Event = $EM_Booking->get_event();						
    						
    	$booking_wp_name = $EM_Event->output("#_EVENTLINK");
    	$booking_date = $EM_Booking->booking_date;
    
    	echo $booking_wp_name;
    	echo 'Booking date: '.$booking_date;
    	
    	var_dump($EM_Booking);
    	
    	if( $date_today == $booking_date) {
    		$today_booked = true;									
    	}
    	else {
    		$today_booked = false;
    	}															
    
    }
    • This reply was modified 3 years, 10 months ago by Twiks Media.
    Plugin Support angelo_nwl

    (@angelo_nwl)

    just to confirm, can I know where are trying the snippet above? are you using a hook or filter?

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Get booking date’ is closed to new replies.