Support

Home Forums Event Espresso Premium Show tickets remaining in EE4?

Show tickets remaining in EE4?

Posted: May 4, 2020 at 9:15 pm


web@the-collaborative.net

May 4, 2020 at 9:15 pm

Hey there. I’m trying to display tickets remaining as part of the excerpt in both the widget and the calendar.

I found this: https://eventespresso.com/topic/available-spaces-in-ee4/#post-145670

But I’m finding two issues.

#1: It doesn’t actually show a number of tickets remaining.

And #2: This shortcode doesn’t work in the widget excerpt.

Any tips on making this work?


Tony

  • Support Staff

May 5, 2020 at 4:39 am

Hi there,

Just to clarify, that code adds a [show_capacity] shortcode so I assume you’ve added that to the content?

#1: It doesn’t actually show a number of tickets remaining.

What does it show?

And #2: This shortcode doesn’t work in the widget excerpt.

Which widget are you referring to?


web@the-collaborative.net

May 5, 2020 at 2:06 pm

Hey Tony!

I added the code to a custom plugin. Is there somewhere else I should have also added it?

I included the shortcode in the event WYSIWYG editor, but it only shows the text from the shortcode (so, in this case, “Remaining Tickets”), not a number of tickets remaining.

I tried to use the shortcode in the excerpt, but it doesn’t show anything. You can see the shortcode [show_capacity] from the user side.

The widget… I’ve got the Widget Event Espresso Upcoming Events in a sidebar – it’s the one that pulls a list of upcoming events including the excerpt – but that shortcode doesn’t do anything there. (Perhaps there’s a better option – I see there’s an event list shortcode – is there a way to have that shortcode show ONLY the title, date, and excerpt, rather than the entire event details?)


Tony

  • Support Staff

May 6, 2020 at 3:03 am

I added the code to a custom plugin. Is there somewhere else I should have also added it?

You can only have one instance of a function, so you wouldn’t add code in more than one place and the recommended place to add custom functions is within a custom functions plugin, so no, that’s fine.

I included the shortcode in the event WYSIWYG editor, but it only shows the text from the shortcode (so, in this case, “Remaining Tickets”), not a number of tickets remaining.

Ok, so the shortcode is parsing otherwise the ‘Remaining Tickets’ wouldn’t show.

The code will output nothing when the datetimes in the event don’t have a limit set on them, as then the remaining tickets are infinite.

Do you have a limit set on the datetime?

I tried to use the shortcode in the excerpt, but it doesn’t show anything. You can see the shortcode [show_capacity] from the user side.

It depends what/where the excerpt is being output as EE doesn’t control everything. Where are you check-in the excerpt to see the shortcode?

The widget… I’ve got the Widget Event Espresso Upcoming Events in a sidebar – it’s the one that pulls a list of upcoming events including the excerpt – but that shortcode doesn’t do anything there.

Ok, so thats the EE Upcoming Events Widget, we’ll come back to this shortly due to this:

(Perhaps there’s a better option – I see there’s an event list shortcode – is there a way to have that shortcode show ONLY the title, date, and excerpt, rather than the entire event details?)

You can change the output of the event lists, but it will change both the shortcode and the default event listing shown on /events/ (by default).

Go to Event Espresso -> Events -> Templates (tab)

On that page is a ‘Event List Pages’ section.

You can set what is output on the event lists there. So you could set the ‘Display Description’ option to excerpt and then pretty much all of the other options in that section to no.


web@the-collaborative.net

May 6, 2020 at 1:51 pm

Aha! So the datetime WAS the issue (THANK YOU!). That shortcode is working in the main WYSIWYG editor.

And I think the workaround for the excerpt will be to modify the template for the Event List.

Thank you SO MUCH.


Tony

  • Support Staff

May 7, 2020 at 4:26 am

You’re most welcome.

Any further questions just let us know.

The support post ‘Show tickets remaining in EE4?’ 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