PHP function to know if an event has booking enabled

WordPress Event Management, Calendars & Registration Forums General Question PHP function to know if an event has booking enabled

This topic contains 1 reply, has 2 voices, and was last updated by  Stephen Harris 10 years, 1 month ago.

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #14879

    Hello,

    I use a function to display the places left for the events (founded here : http://codex.wp-event-organiser.com/function-eo_get_remaining_tickets_count.html). But I would like to add an “if” to check if the event has the booking enabled. Because on some events, I do not want to use a booking system so I do not want to see the places left, which actually says “sold out”.

    Nicolas Massart
    #14891

    Hi Nicolas,

    You can use eo_get_event_tickets() – it returns all the tickets associated with an event. (See codex).

    There’s no option to turn bookings on / off for a specific event: An event is considered to have bookings enabled, if it has a ticket associated to it.

    An alternative function is eo_get_event_tickets_on_sale() – which filters out any tickets from the above which aren’t currently on sale (note, this ignores where there’s actually any tickets remaining).

    Stephen Harris
Viewing 2 posts - 1 through 2 (of 2 total)
To enable me to focus on Pro customers, only users who have a valid license for the Pro add-on may post new topics or replies in this forum. If you have a valid license, please log-in or register an account using the e-mail address you purchased the license with. If you don't you can purchase one here. Or there's always the WordPress repository forum.