query to check if tickets are available

Home Forums Ticket Products Event Tickets Plus query to check if tickets are available

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #930321
    Tony
    Participant

    I am trying to add a message at the top of an event if tickets are available or sold out. How can I check the availability of tickets for an event within the loop? I know how to hook the content I want to add, I just don’t know how to query if tickets are available or sold out. Something like this:

    if (the event does not sell tickets) {
    return
    }

    elseif (tickets are available) {
    do something
    }

    elseif (tickets are sold out) {
    do something else
    }

    #930425
    Barry
    Member

    Hi Tony, great question!

    We’ve actually got a number of helper functions that you might be interested in:

    You can optionally pass the post ID of a specific event to each of those functions or – if you are already within something like the single event template – it will assume you are referring to the currently queried event (wherever that makes sense).

    Does that help?

    #930588
    Tony
    Participant

    Wonderful functions! Thanks

    #930858
    Barry
    Member

    Our pleasure – glad they’re of some help 🙂

    I’ll go ahead and close out this topic, but if we can help with anything else please don’t hesitate to let us know by opening new topics as required – one of the team will be only too happy to help.

    Last but not least, if you have a moment to spare, we’d love to hear about your experiences with The Events Calendar so far over on our plugin review page.

    Thanks again!

Viewing 4 posts - 1 through 4 (of 4 total)
  • The topic ‘query to check if tickets are available’ is closed to new replies.