/** * Returns true if the event contains one or more tickets which are not * subject to any inventory limitations. * * @param null $event * * @return bool */ function tribe_events_has_unlimited_stock_tickets($event = null) { if (null === ($event = tribe_events_get_event($event))) { return 0; } foreach (Tribe__Events__Tickets__Tickets::get_all_event_tickets($event->ID) as $ticket) { if (Tribe__Events__Tickets__Ticket_Object::UNLIMITED_STOCK === $ticket->stock) { return true; } } return false; }
/** * Adds ticket data to the offers property of the event object. */ protected function add_ticket_offers() { foreach (Tribe__Events__Tickets__Tickets::get_all_event_tickets($this->event_id) as $this->ticket) { $this->add_individual_offer(); } }