Support

Home Forums Event Espresso Premium Spaces remaining column gone after update, using ESPRESSO_EVENTS_TABLE_TEMPLATE

Spaces remaining column gone after update, using ESPRESSO_EVENTS_TABLE_TEMPLATE

Posted: January 31, 2025 at 3:00 am

Viewing 3 reply threads


create_kb

January 31, 2025 at 3:00 am

Hi,
I just updated EE and the output using the Table Template add-on has removed the column for Spaces remaining. You can see here it used to look like this – https://web.archive.org/web/20240301100147/https://www.positive2workskillnet.ie/upcoming-courses/

But now that column is gone – https://www.positive2workskillnet.ie/upcoming-courses/

I am using the shortcode in the page content like [ESPRESSO_EVENTS_TABLE_TEMPLATE show_expired=false table_style=metro order_by=start_date sort=DESC table_pages = 20]
How can I get the Spaces Remaining column back?
Thanks,


Tony

  • Support Staff

January 31, 2025 at 3:15 am

Hi there,

The Events Table output does not (nor has ever) include a spaces remaining column in the official template, so to load that column you must have been using a custom template.

Did you update the theme at the same time?

There’s a few locations that template could of been loading from:

Theme – usually within your theme’s root directory.

/wp-content/uploads/espresso/ – template files can load from this location although we advise using a child theme over this now.

The template within the add-on itself was modified and you’ve since updated the add-on (which wipes out any customizations).

Check the above 2 locations for espresso-events-table-template.template.php to see if the file is there an just not loading, but if was stored in the theme and you’ve updated the theme it will no longer be there.


create_kb

January 31, 2025 at 3:35 am

Hi Tony,
No the theme was not updated, and we use a child theme anyway. So I looked in the uploads/espresso/ folder and found a file espresso-events-table-template.template.php. In it there is code:
<table id="ee_filter_table" class="espresso-table footable table" data-page-size="<?php echo $table_pages; ?>" data-filter="#filter">
<thead class="espresso-table-header-row">
<tr>
<th class="th-group"><?php _e('Event','event_espresso'); ?></th>
<th class="th-group"><?php _e('Venue','event_espresso'); ?></th>
<th class="th-group"><?php _e('Spaces Remaining','event_espresso'); ?></th>
<th class="th-group"><?php _e('Date','event_espresso'); ?></th>
<th class="th-group" data-sort-ignore="true"></th>
</tr>
</thead>

And further down:
<tr class="espresso-table-row <?php echo $category_slugs; ?>">
<td class="event_title event-<?php echo $post->ID; ?>"><?php echo $post->post_title; ?></td>
<td class="venue_title event-<?php echo $post->ID; ?>"><?php espresso_venue_name( NULL, FALSE ); ?></td>
<td class="space_remaining event-<?php echo $post->ID; ?>"><?php $total_spaces_left = $datetime->spaces_remaining(); echo $total_spaces_left === INF ? '<span class="smaller-text">' . __( 'unlimited ', 'event_espresso' ) . '</span>' : $total_spaces_left; ?></td>
<td class="start_date event-<?php echo $post->ID; ?>" data-value="<?php echo $datetime->get_raw( 'DTT_EVT_start' ); ?>">

This file is dated from 2020, so did not change recently. Does something need to change around the $total_spaces_left variable to work with the updated EE plugin?
There is also a file named espresso-events-table-template-toggle.template.php in this same folder. Not sure if that is relevant.


Tony

  • Support Staff

January 31, 2025 at 6:06 am

No, looks like this is a bug in our locate_template function within core (used by add-ons to locate custom templates).

/wp-content/uploads/espresso/ is a deprecated location, but the order is currently incorrect, so it’s basically ignored.

Pull both of those files into your child theme’s root directory and they should start loading again.

I’ll create a ticket to ‘fix’ the method within core, however, /wp-content/uploads/espresso/ will throw a deprecation notice each time it loads a template from it, so switching to load within your child theme now will prevent that from happening.

Viewing 3 reply threads

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

Event Espresso