Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- function my_get_ticket_booked_spaces( $booked_spaces, $EM_Ticket ){
- global $wpdb;
- $table_name = $wpdb->prefix.'em_tickets_bookings';
- $table_booking = $wpdb->prefix.'em_bookings';
- $booked_spaces = $wpdb->get_var('
- SELECT SUM(t.ticket_booking_spaces) AS booked_space
- FROM '.$table_name.' t
- LEFT JOIN '.$table_booking.' b ON t.booking_id = b.booking_id
- WHERE
- b.booking_status = 1 AND
- t.ticket_id='. absint($EM_Ticket->ticket_id) .' GROUP BY t.ticket_id');
- return $booked_spaces;
- }
- add_filter('em_ticket_get_booked_spaces', 'my_get_ticket_booked_spaces', 100, 2 );
Advertisement