Support

Home Forums Event Espresso Premium Displaying number of unsold TICKETS

Displaying number of unsold TICKETS

Posted: November 7, 2019 at 5:14 am


dee4dogs

November 7, 2019 at 5:14 am

Hello.

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:
https://eventespresso.com/topic/available-spaces-in-ee4/#post-145623

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.


Tony

  • 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:

https://gist.github.com/Pebblo/bf2dc6c31a806716a3656ba3a8b1df82

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:

https://gist.github.com/Pebblo/339e8b993769bedc5bec0f84af943098

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:

https://eventespresso.com/wiki/create-site-specific-plugin-wordpress-site/


dee4dogs

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.


Tony

  • 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.

Event Espresso