Support

Home Forums Event Espresso Premium 404 Error for Event Detail Page when the event is sold out

404 Error for Event Detail Page when the event is sold out

Posted: October 29, 2018 at 10:53 am


Jonathan

October 29, 2018 at 10:53 am

I have just sold out my first event, woohoo.. I did setup the waitlist plugin to capture others who are interested however now that the event is sold out the event detail page just gets a 404 error. I have no clue how to work out what is causing this. Please help


Josh

  • Support Staff

October 29, 2018 at 11:13 am

Hi,

Usually the event should still be published even after it’s sold out. If you go in to edit the event is there a Publish button?


Jonathan

October 29, 2018 at 11:19 am

Yes there is a publish button, I even pressed PUBLISH but then I got a message “Please note that the Event Status has automatically been changed to Sold Out because there are no more spaces available for this event. However, this change is not permanent until you update the event. You can change the status back to something else before updating if you wish.” and then the button PUBLISH shows again.


Josh

  • Support Staff

October 29, 2018 at 11:47 am

That part is expected. What’s not expected is the 404 error. Just above the Publish button, there will be a Visibility option. Is that option set to Public?


Jonathan

October 29, 2018 at 12:25 pm

yes it is.


Josh

  • Support Staff

October 29, 2018 at 1:35 pm

If you go to WP Dashboard > Settings > Permalinks (simply load that page, no need to change anything there) does the 404 error persist?


Jonathan

October 29, 2018 at 1:37 pm

no. works find


Josh

  • Support Staff

October 29, 2018 at 1:48 pm

Do you mean “works fine” or is the event page still returning a 404 error?


Jonathan

October 29, 2018 at 1:51 pm

to clarify I went to WP Dashboard > Settings > Permalinks (I didn’t save anything) and that page loads fine with no 404 and then I went to the event detail page its still 404


Josh

  • Support Staff

October 29, 2018 at 2:19 pm

OK, thanks for making that clear. What you can do next rule out a plugin or theme conflict. One way to do this is install the Health Check plugin, then go to WP → Dashboard → Heath Check → Troubleshooting. There you’ll Enable Troubleshooting Mode, then once that’s activated you’ll reactivate Event Espresso only via the Health Check’s Troubleshooting item in the WP admin bar. At that point, can you check to see if the issue persists?


Jonathan

October 29, 2018 at 7:03 pm

ok so I installed that and identified it is something in the theme I am using that is causing the 404. So what now? can you help me??


Josh

  • Support Staff

October 29, 2018 at 7:53 pm

If there’s a way we can download a copy of the theme we can take a look at its code to see where it needs to be amended in order to avoid 404 errors. If you can upload to a dropbox or similar file share, then post a link here we can go from there.


Jonathan

October 29, 2018 at 8:08 pm

This reply has been marked as private.


Josh

  • Support Staff

October 29, 2018 at 9:02 pm

Here’s a fix for the Tennis Club theme:

https://gist.github.com/joshfeck/16407ed5c86c029127959c7ed8a44c29

You can add the above to a functions plugin or if you use a child theme, into your WordPress child theme’s functions.php file.


Jonathan

October 29, 2018 at 9:47 pm

great. that worked and I can see the event again!! thanks so much.

So my minor problem now is I have the buy tickets box at the top and bottom of the page and the WAIT LIST is now working. However when you use the bottom WAITING LIST button the popup doesn’t appear on the visible part of the page, you have to scroll up and feels like its broken. Any ideas on how to fix this?
thanks again


Josh

  • Support Staff

October 30, 2018 at 7:51 am

May I ask how was it that you added a second ticket selector table? Normally there should only be one.


Jonathan

October 31, 2018 at 12:07 pm

I copied the “content-espresso_events.php” file to my child theme and then edited it e.g.

<?php
/**
 * This template will display a single event - copy it to your theme folder
 *
 * @ package		Event Espresso
 * @ author		Seth Shoultes
 * @ copyright	(c) 2008-2013 Event Espresso  All Rights Reserved.
 * @ license		https://eventespresso.com/support/terms-conditions/   * see Plugin Licensing *
 * @ link			http://www.eventespresso.com
 * @ version		4+
 */

/*************************** IMPORTANT *************************
 * if you are creating a custom template based on this file,
 * and do not wish to use the template display order controls in the admin,
 * then remove the following filter and position the additional template parts
 * that are loaded via the espresso_get_template_part() function to your liking
 * and/or use any of the template tags functions found in:
 * \wp-content\plugins\event-espresso-core\public\template_tags.php
 ************************** IMPORTANT **************************/
add_filter( 'FHEE__content_espresso_events__template_loaded', '__return_true' );

//echo '<br/><h6 style="color:#2EA2CC;">'. __FILE__ . ' &nbsp; <span style="font-weight:normal;color:#E76700"> Line #: ' . __LINE__ . '</span></h6>';

global $post;
$event_class = has_excerpt( $post->ID ) ? ' has-excerpt' : '';
$event_class = apply_filters( 'FHEE__content_espresso_events__event_class', $event_class );
?>
<?php do_action( 'AHEE_event_details_before_post', $post ); ?>
<article id="post-<?php the_ID(); ?>" <?php post_class( $event_class ); ?>>

<?php if ( is_single() ) : ?>
<section class="post_featured">
	<div id="espresso-event-header-dv-<?php echo $post->ID;?>" class="espresso-event-header-dv">
		<?php espresso_get_template_part( 'content', 'espresso_events-thumbnail' ); ?>
	<!--	<?php espresso_get_template_part( 'content', 'espresso_events-header' ); ?> -->
	</div>
	</section>

	<div class="espresso-event-wrapper-dv">
	    <?php
//* Please do NOT include the opening php tag, except of course if you're starting with a blank file
add_action( 'AHEE__ticket_selector_chart__template__after_ticket_selector', 'ee_print_number_of_tickets', 10, 2 );
function ee_print_number_of_tickets( $EVT_ID, $event ) {
  if ( $event instanceof EE_Event ) {
    if ( ! $event->is_sold_out() && $event->is_upcoming() ) {
      //get total approved registrations count
      $spots_taken = EEM_Registration::instance()->count(array(
        array(
          'EVT_ID' => $EVT_ID,
          'STS_ID' => EEM_Registration::status_id_approved,
        ),
      ), 'REG_ID', true);
      $html = '<div class="total-tickets"><h6>';
      $html .= $spots_taken;
      $html .= ' sold of ';
      $html .= $event->total_available_spaces();
      $html .= ' total available</h6></div>';
      echo $html;
    }
  }
} 

?>
	<?php espresso_get_template_part( 'content', 'espresso_events-datetimes' ); ?>
		<?php espresso_get_template_part( 'content', 'espresso_events-tickets' , 'above' ); ?>
		
		
		<h4>Event Description</h4>
		 <?php espresso_get_template_part( 'content', 'espresso_events-details' ); ?>
<?php espresso_get_template_part( 'content', 'espresso_events-venues' ); ?>
<?php espresso_get_template_part( 'content', 'espresso_events-tickets' , 'below'); ?>
		<footer class="event-meta">
			<?php do_action( 'AHEE_event_details_footer_top', $post ); ?>
			<?php do_action( 'AHEE_event_details_footer_bottom', $post ); ?>
		</footer>
	</div>
	

			
			              

	
	

	

<?php elseif ( is_archive() ) : ?>

	<div id="espresso-event-list-header-dv-<?php echo $post->ID;?>" class="espresso-event-header-dv">
		<?php espresso_get_template_part( 'content', 'espresso_events-thumbnail' ); ?>
		<?php espresso_get_template_part( 'content', 'espresso_events-header' ); ?>
	</div>

	<div class="espresso-event-list-wrapper-dv">
		<?php espresso_get_template_part( 'content', 'espresso_events-tickets' ); ?>
		<?php espresso_get_template_part( 'content', 'espresso_events-datetimes' ); ?>
		<?php espresso_get_template_part( 'content', 'espresso_events-details' ); ?>
		<?php espresso_get_template_part( 'content', 'espresso_events-venues' ); ?>
	</div>

<?php endif; ?>

</article>
<!-- #post -->
<?php do_action( 'AHEE_event_details_after_post', $post );


Josh

  • Support Staff

October 31, 2018 at 12:15 pm

OK so was it intended to have two identical ticket selectors or you only want one ticket selector? If one, which one?


Jonathan

October 31, 2018 at 12:20 pm

I want 1 at top of content and 1 at bottom as your event descriptions are long. I do want them both to stay. thanks


Josh

  • Support Staff

October 31, 2018 at 1:17 pm

You can add this to your site’s custom stylesheet to fix the issue with the extra ticket selector & the wait list form:

.event_wait_list-hidden-inputs {
position:fixed;
top:0;
right:50%
}

The support post ‘404 Error for Event Detail Page when the event is sold out’ 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