Home Forums Event Espresso Premium Displaying number of unsold TICKETS

Displaying number of unsold TICKETS

Posted: November 7, 2019 at 5:14 am


November 7, 2019 at 5:14 am


I would like to display the number of unsold tickets available for a class.
We have just stopped limited date-times, so the script here wont work for us:

We limit tickets rather than date-times because we sell the dog training class tickets and then give people the option to order in advance items (such as leashes, toys and chews) that they will use in the class.

To make this slightly more complicated… I only want to display the number of unsold tickets that are “attendance” tickets, and not the items/equipment. The classes all have a attendance limited number, but people could buy as many chew/toy “tickets” as they want.

The attendance tickets are set as REQUIRED in the advance settings of the ticket… so I guess the lookup could pull that up?

I’m just not good enough at PHP to know how to do this.
Thank you so much.


  • Support Staff

November 8, 2019 at 8:31 am

Hi there,

I’ve provided an example of how to pull the required tickets for an event previously here:

So if pulling the required ticket(s) from an event and combining the remaining sale values from each of those you can do something like this:

You’ll need to alter the function to return the specific you need but that should get you up and running.

You can add that to a custom functions plugin on your site, we have some documentation on creating one here:


November 11, 2019 at 12:51 pm

Awesome… I’ve mashed that together with the other code… and it works great. Thanks for your help.


  • Support Staff

November 11, 2019 at 3:32 pm

You’re most welcome, I’m glad it worked for you.

The support post ‘Displaying number of unsold TICKETS’ is closed to new replies.

Have a question about this support post? Create a new support post in our support forums and include a link to this existing support post so we can help you.

Do NOT follow this link or you will be banned from the site!