getPRO()) return; // MEC Settings $settings = $this->get_settings(); $ml_settings = $this->get_ml_settings(); // Booking module is disabled if(!isset($settings['booking_status']) or (isset($settings['booking_status']) and !$settings['booking_status'])) return; // Skip First Step $skip_step1 = (isset($settings['booking_skip_step1']) and $settings['booking_skip_step1']) ? true : false; $uniqueid = ''; $uniqueid = apply_filters('mec_booking_uniqueid_value', $uniqueid); $event = $event[0]; $uniqueid = (isset($uniqueid) && !empty($uniqueid) ? $uniqueid : $event->data->ID); $tickets = isset($event->data->tickets) ? $event->data->tickets : array(); $dates = isset($event->dates) ? $event->dates : $event->date; // No Dates if(!count($dates)) return; // No Tickets if(!count($tickets)) return; // Abort Booking Module $abort = apply_filters('mec_booking_module_abort', false, $event); if($abort !== false) { echo $abort; return; } // Shortcode Options if(!isset($from_shortcode)) $from_shortcode = false; if(!isset($ticket_id)) $ticket_id = NULL; $book = $this->getBook(); // User Booking Limits list($user_ticket_limit, $user_ticket_unlimited) = $book->get_user_booking_limit($event->data->ID); // Generate JavaScript code of Booking Module $javascript = ''; $do_skip = false; if($skip_step1 and count($tickets) === 1 and count($dates) === 1 and $user_ticket_limit == 1 and !$user_ticket_unlimited) { $do_skip = true; $javascript .= ''; } $javascript = apply_filters('mec-javascript-code-of-booking-module', $javascript, $uniqueid); // Include javascript code into the footer if($this->is_ajax()) echo $javascript; else { $factory = $this->getFactory(); $factory->params('footer', $javascript); } ?>