Support

Home Forums Event Espresso Premium Event List Showing Available Space for Completely Sold-Out Events

Event List Showing Available Space for Completely Sold-Out Events

Posted: February 13, 2025 at 1:50 am

Viewing 4 reply threads


Mark

February 13, 2025 at 1:50 am

Hi,

I have overridden the content-espresso_events-shortcode.php file in my child theme, and I am using the following code:

Check template code : https://app.screencast.com/mW2hmTX56Yw1Z

The issue I am facing is with the Available Space display. The event list generated by this shortcode shows available spaces for events that are actually completely sold out.

Issue Details:
The event list page displays available space for events.
However, when I click Register and get redirected to the ticket page, the tickets are marked as Sold Out.
The issue seems to be that the event list page does not reflect the actual available space correctly.

Screenshots:
Event Showing Available Space : https://app.screencast.com/YkEfkobRiUWJM
Event Tickets Showing Sold Out: https://app.screencast.com/t5K1Lz8TgIXM2

Could you please check (url: https://firstaidkelowna.ca/first-aid-and-cpr-courses/emergency-first-aid/) and guide me on why the available space is still showing for events that are completely sold out?

Thanks!


Tony

  • Support Staff

February 13, 2025 at 4:05 am

Hi Mark,

It looks like the code is currently commented out as I can’t see available spaces listed, correct?

Pick an event this is happening on and link me directly to that event please, we’ll focus on that one eent as it’s likely the same issue throughout.

Then post a screenshot of all of the datetimes and tickets available for that event within the editor (make sure there aren’t any filters applied on the output, see HERE and HERE)


Mark

February 13, 2025 at 11:35 pm

Hi Tony,

Yes, I had commented out the available space because it was misleading users. I have now removed the comment for this event so you can review the issue.

Here is the url of one of the event where the issue is occurring:
Event url: https://firstaidkelowna.ca/events/emergency-first-aid-with-basic-life-support-bls-course-in-kelowna-598/

Below are the screenshots of the event’s Datetimes and Ticket Availability settings in the admin editor, as requested:
Datetimes: https://app.screencast.com/50MqpCn3Hplgf
Ticket Availability: https://app.screencast.com/fbyLzg7ivX6Am


Tony

  • Support Staff

February 14, 2025 at 5:53 am

Hmmm, it is being caused by the archived ticket, the event space calculator isn’t taking those into consideration when used with that specific function.

Right above that call add this:

$tickets = $event->tickets(
	[
		'default_where_conditions' => 'none',
		'order_by' => ['TKT_qty' => 'ASC'],
	]
);
$event->getAvailableSpacesCalculator()->setActiveTickets($tickets);

That should fix it.

I’ve opened a ticket to discuss this further with the team.


Mark

February 15, 2025 at 3:00 am

I have implemented the code you provided, and it works. However, I noticed an issue:

It only worked when all the tickets in that event has been purchased. But if an event hs a total capacity of 8 tickets and 5 of them purchased and 3 left, but we marked that event as sold out, it still shows the spaces left instead of sold out.

The event should be marked as “Sold Out” in both of the following conditions:

1. All 8 spaces have been purchased → The event should show “Sold Out.”
2. Some spaces remain, but we manually mark the event as Sold Out → Instead of displaying the remaining spaces, it should also show “Sold Out.”

Check this event where the issue is still occurring. We manually marked it as ‘Sold Out,’ but the available spaces are still being displayed:
url: https://firstaidkelowna.ca/events/standard-first-aid-course-in-kelowna-659/

Screenshot showing the event date, time, and available tickets.
screenshot: https://app.screencast.com/l2OxMHE3H5eQ9

Viewing 4 reply threads

You must be logged in to reply to this support post. Sign In or Register for an Account

Event Espresso