Check if there are any events with tickets for sale

WordPress Event Management, Calendars & Registration Forums General Question Check if there are any events with tickets for sale

This topic contains 3 replies, has 2 voices, and was last updated by  Stephen Harris 9 years, 10 months ago.

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #16349

    Hi! I am hoping to check via php if there are any events with tickets. we are trying to optionally display a banner to buy tickets, but only when there are upcoming events with tickets enabled. Is there a code for that?

    Thanks!

    handhugs
    #16373

    You can check if an event has tickets currently on sale using: eo_get_event_tickets_on_sale() (See codex). It will return an empty array if not.

    Stephen Harris
    #16376

    but I want to check if there are any events with tickets, not just if the event in the loop has tickets. Sometimes we don’t have any events and I want to show the banner only if we have upcoming events with tickets in general.

    handhugs
    #16377

    Ah, I see, I’m afraid that isn’t possible. The only way would be to pull down a certain number of events and check which one(s) have tickets currently on sale.

    Stephen Harris
Viewing 4 posts - 1 through 4 (of 4 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.