I am trying to customize the Upcoming Events Widget template.
In the template there is:
echo $status_display; //Turn this on to display the overall status of the event.
This is close to what I want. When I add this to my template it correctly says “Open”. But when the max number of attendees is reached for the event, it does not change the status. Is there a way I can tie into custom messages to display “Sold Out” for events that have reached max attendance?
You would need to compare the reg_limit for the event, with the attendee registered onto that event and see if there are spaces available.
Luckily we have a function that will do that for you, here is a quick example to simply echo back “Sold out” when the event reg limit is reached.
You’ll need to add the function to get the number of available spaces within the event, add this within the foreach loop for the events, around line 116:
You could do much more and add extra styling to this but the basic idea is the same. I added that to the widget.php template on line 132 but within the Span and a tag but again you could do this differently- http://take.ms/QWJ5n
Yes, that is exactly what I was looking for. Thank You!
Viewing 2 reply threads
The support post ‘EE3 Upcoming Events Widget Sold Out Events’ 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.
Support forum for Event Espresso 3 and Event Espresso 4.