Support

Home Forums Event Espresso Premium Can I add "Sold Out" to the Event List display when an event is full?

Can I add "Sold Out" to the Event List display when an event is full?

Posted: July 3, 2013 at 5:11 am


Cynthia Brown

July 3, 2013 at 5:11 am

I would like to add “Sold Out” to the event list display for an event that is maxed. The only thing that happens is the “Register” button disappears and it’s not clear that the event is full. Go to http://www.quincycitycrossfit.com/foundations/ and click on the “Registration” tab. The first event, Foundations July 8-16 6:30 AM is sold out and I’d like to indicate that. Appreciate your help!


Dean

July 3, 2013 at 5:31 am

Hi,

What I would do is modify the event_list_display.php template.

Copy the event_list.php (required!) and event_list_display.php files to wp-content/uploads/espresso/templates/

There, edit the event_list display.php file.

At around line 38 you should see some code starting

//You can also display a custom message. For example, this is a custom registration not open message:

compare it to the code below and modify as needed. What it does is check the attendee count. If it is 0 (fully booked) it will display Sold Out! next to the title. I added in a span wrapper with a class in case you wanted to style the words.

//You can also display a custom message. For example, this is a custom registration not open message:
$status_display_custom_closed = $status['status'] == 'REGISTRATION_CLOSED' ? ' - <span class="espresso_closed">' . __('Regsitration is closed', 'event_espresso') . '</span>' : '';
global $this_event_id;
$this_event_id = $event_id;
?>
<div id="event_data-<?php echo $event_id ?>" class="event_data <?php echo $css_class; ?> <?php echo $category_identifier; ?> event-data-display event-list-display event-display-boxes ui-widget">

<?php

$dr_attendeecount = get_number_of_attendees_reg_limit($event_id, 'available_spaces', 'All Seats Reserved');

if ($dr_attendeecount == 0) { $dr_soldout = '<span class="soldout"> - SOLD OUT!</span>'; } else {$dr_soldout = ''; }
?>

<h3 id="event_title-<?php echo $event_id ?>" class="event_title ui-widget-header ui-corner-top"><a title="<?php echo stripslashes_deep($event_name) ?>" class="a_event_title" id="a_event_title-<?php echo $event_id ?>" href="<?php echo $registration_url; ?>"><?php echo stripslashes_deep($event_name) ?>
<?php echo $dr_soldout; ?></a>

If nothing else, that should give you an idea on what to do.


Cynthia Brown

July 5, 2013 at 1:15 pm

Perfect! Thank you very much!

The support post ‘Can I add "Sold Out" to the Event List display when an event is full?’ 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