Support

Home Forums Event Espresso Premium Show Spaces left for a particular tocket type in Calendar Rollover

Show Spaces left for a particular tocket type in Calendar Rollover

Posted: February 27, 2019 at 6:55 pm


LarnieBee

February 27, 2019 at 6:55 pm

Hey guys,

I have a bunch of events set up on a claendar: https://fishability.org.au/events-calendar/

On rollover, you can see the Registrations / Spaces: 10 / 110 text.

I’m wondering if there is a way to only show info for 1 particular ticket type for that event.

For example, I have 2 ticket types. Both have 10 spaces, so 20 total
I only want to show 10 spaces available for the one ticket type and leave the other one out.

Is that possible?


Tony

  • Support Staff

February 28, 2019 at 2:54 am

Hi there,

So in total for your event, do you have 10 spaces or 20 spaces?

The reason I ask is if you only have 10 spaces on the event, if you set the datetime qty to 10 is will show 10/10.

Also note that the number is ‘available spaces’ meaning if 10 people registered on the above event, it would display 10/0


LarnieBee

February 28, 2019 at 3:51 am

Sorry I must not have explained that well.

I have two types of Tickets
Participant Tickets = 10
&
Volunteer Tickets = 10

Currently the rollover on the calendar shows 20 available spaces if there are no registrations.
I would like for it to only show Participant spaces, so 10.
If a Volunteer ticket is registered then this number would be unaffected.

I hope that makes more sense.


Tony

  • Support Staff

February 28, 2019 at 4:51 am

Ah ok, I see.

Theres a filter in the calendar add-on for that value so yes you can, the filter is:

apply_filters('FHEE__EE_Calendar__tooltip_datetime_available_spaces', $datetime->total_tickets_available_at_this_datetime(), $datetime);

I’m assuming this isn’t the case for all of your events?


LarnieBee

February 28, 2019 at 5:07 am

Oh cool. Nope, this is the same for every event on this site. Every event only needs to show the “Participant” ticket type on the rollover.

So do you mind pointing me in the right direction on how to do this?
Thank you1


Tony

  • Support Staff

March 1, 2019 at 3:47 am

You’ll need something like this:

https://gist.github.com/Pebblo/65597083f820ddbb6184c0a3aa5fe61c

Which pulls the first ticket in an event based on the order set in the admin, checks if it has ‘Participant’ in the ticket name and then returns the saleable qty for that specific ticket.

If the ticket doesn’t have the correct string it will return the default value.


LarnieBee

March 1, 2019 at 6:47 pm

Perfect. so I have loaded that function in but it doesn’t seem to be working.
Is that because the ticket name in full is “Participant Registration” or should it work because “Participant” is contained in the name?

I’m just seeing the old results.


LarnieBee

March 1, 2019 at 6:48 pm

Wait! It’s working. I had me a caching issue I think. Thankyou. Very cool.

Lastly, is there any way to drop the Registrations bit and just show available spaces?


Tony

  • Support Staff

March 4, 2019 at 3:53 am

Not currently, no.

There’s no filter to completely remove it, you can change the text but even if you set that to be an empty string, the registration sold count would still show.

The support post ‘Show Spaces left for a particular tocket type in Calendar Rollover’ 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