• Resolved newbie0117

    (@newbie0117)


    Hi,

    Same issue has popped up. The full name and email information requirement was being autocomplete / autofill as the event settings had the options enabled:

    1. Require users to log in before they RSVP
    2. Require users to log in before they purchase tickets

    Not sure what changed, but now the section doesn’t autofill the full name nor email of a logged in user(s) and there is new code in rsvp.min.css to hide the section:

    .tribe-tickets-meta-row {
        display: none;
    }

    All users now get the error:
    Please fill in the RSVP confirmation name and email fields.

    Have beeing using this gist’s code to default the field to and add a max value of ‘1’.

    //Disable number counter for rsvp
    add_action( 'wp_footer', 'tribe_limit_rsvps_to_one' );
    
    function tribe_limit_rsvps_to_one() {
    	wp_enqueue_script( 'jquery' );
    ?>
    	<script>
    		jQuery(document).ready(function($){
    			if ( $('.tribe-events-tickets' ).length ) {
    				var $input = $('.tribe-events-tickets' ).find( 'input.tribe-ticket-quantity' );
    				$input.attr( 'type', 'text' );
    				//$input.attr( 'disabled', 'disabled' );
    				$input.attr( 'max', '1' );
    				$input.val( '1' );
    			}
    		});
    	</script>
    <?php 
    }
Viewing 5 replies - 1 through 5 (of 5 total)
  • Thread Starter newbie0117

    (@newbie0117)

    Works again with this:

    <?php
    /**
     * This template renders the RSVP ticket form
     *
     * @version 4.2.7
     *
     * @var bool $must_login
     */
    $is_there_any_product         = false;
    $is_there_any_product_to_sell = false;
    ob_start();
    $messages = Tribe__Tickets__RSVP::get_instance()->get_messages();
    $messages_class = $messages ? 'tribe-rsvp-message-display' : '';
    $now = current_time( 'timestamp' );
    ?>
    <form action="" class="cart <?php echo esc_attr( $messages_class ); ?>" method="post" enctype='multipart/form-data'>
    	<h2 class="tribe-events-tickets-title"><?php esc_html_e( 'RSVP', 'event-tickets' ) ?></h2>
    	<div class="tribe-rsvp-messages">
    		<?php
    		if ( $messages ) {
    			foreach ( $messages as $message ) {
    				?>
    				<div class="tribe-rsvp-message tribe-rsvp-message-<?php echo esc_attr( $message->type ); ?>">
    					<?php echo esc_html( $message->message ); ?>
    				</div>
    				<?php
    			}//end foreach
    		}//end if
    		?>
    		<div class="tribe-rsvp-message tribe-rsvp-message-error tribe-rsvp-message-confirmation-error" style="display:none;">
    			<?php esc_html_e( 'Please fill in the RSVP confirmation name and email fields.', 'event-tickets' ); ?>
    		</div>
    	</div>
    	<table width="100%" class="tribe-events-tickets tribe-events-tickets-rsvp">
    		<?php
    		foreach ( $tickets as $ticket ) {
    			// if the ticket isn't an RSVP ticket, then let's skip it
    			if ( 'Tribe__Tickets__RSVP' !== $ticket->provider_class ) {
    				continue;
    			}
    			if ( $ticket->date_in_range( $now ) ) {
    				$is_there_any_product = true;
    				?>
    				<tr>
    					<td class="tribe-ticket quantity" data-product-id="<?php echo esc_attr( $ticket->ID ); ?>">
    						<input type="hidden" name="product_id[]" value="<?php echo absint( $ticket->ID ); ?>">
    						<?php
    						if ( $ticket->is_in_stock() ) {
    							$is_there_any_product_to_sell = true;
    							?>
    							<input type="number" class="tribe-ticket-quantity" min="0" max="<?php echo esc_attr( $ticket->remaining() ); ?>" name="quantity_<?php echo absint( $ticket->ID ); ?>" value="0" <?php disabled( $must_login ); ?> >
    							<?php
    							if ( $ticket->managing_stock() ) {
    								?>
    								<span class="tribe-tickets-remaining">
    									<?php
    									echo sprintf( esc_html__( '%1$s out of %2$s available', 'event-tickets' ), $ticket->remaining(), $ticket->original_stock() );
    									?>
    								</span>
    								<?php
    							}
    						}//end if
    						else {
    							?>
    							<span class="tickets_nostock"><?php esc_html_e( 'Out of stock!', 'event-tickets' ); ?></span>
    							<?php
    						}
    						?>
    					</td>
    					<td class="tickets_name">
    						<?php echo esc_html( $ticket->name ); ?>
    					</td>
    					<td class="tickets_description" colspan="2">
    						<?php echo esc_html( $ticket->description ); ?>
    					</td>
    				</tr>
    				<?php
    				/**
    				 * Allows injection of HTML after an RSVP ticket table row
    				 *
    				 * @var Event ID
    				 * @var Tribe__Tickets__Ticket_Object
    				 */
    				do_action( 'event_tickets_rsvp_after_ticket_row', tribe_events_get_ticket_event( $ticket->id ), $ticket );
    			}
    		}//end foreach
    		if ( $is_there_any_product_to_sell ) {
    			?>
    			<tr class="tribe-tickets-meta-row">
    				<td colspan="4" class="tribe-tickets-attendees">
    					<header><?php esc_html_e( 'Send RSVP confirmation to:', 'event-tickets' ); ?></header>
    					<?php
    					/**
    					 * Allows injection of HTML before RSVP ticket confirmation fields
    					 *
    					 * @var array of Tribe__Tickets__Ticket_Object
    					 */
    					do_action( 'event_tickets_rsvp_before_confirmation_fields', $tickets );
    					$name  = '';
    					$email = '';
    					$current_user = wp_get_current_user();
    					if ( $current_user->ID ) {
    					    
    					    $name  = $current_user->user_firstname . ' ' . $current_user->user_lastname;
    					    $email = $current_user->user_email;
    					}
    					?>
    
    					<table class="tribe-tickets-table">
    						<tr class="tribe-tickets-full-name-row">
    							<td>
    								<label for="tribe-tickets-full-name"><?php esc_html_e( 'Full Name', 'event-tickets' ); ?>:</label>
    							</td>
    							<td colspan="3">
    								<input type="text" name="attendee[full_name]" id="tribe-tickets-full-name" value="<?php echo $name; ?>">
    							</td>
    						</tr>
    						<tr class="tribe-tickets-email-row">
    							<td>
    								<label for="tribe-tickets-email"><?php esc_html_e( 'Email', 'event-tickets' ); ?>:</label>
    							</td>
    							<td colspan="3">
    								<input type="email" name="attendee[email]" id="tribe-tickets-email" value="<?php echo $email; ?>">
    							</td>
    						</tr>
    
    						<tr class="tribe-tickets-order_status-row">
    							<td>
    								<label for="tribe-tickets-order_status"><?php esc_html_e( 'RSVP', 'event-tickets' ); ?>:</label>
    							</td>
    							<td colspan="3">
    								<?php Tribe__Tickets__Tickets_View::instance()->render_rsvp_selector( 'attendee[order_status]', '' ); ?>
    							</td>
    						</tr>
    
    						<?php if ( class_exists( 'Tribe__Tickets_Plus__Attendees_List' ) && ! Tribe__Tickets_Plus__Attendees_List::is_hidden_on( get_the_ID() ) ) : ?>
    							<tr class="tribe-tickets-attendees-list-optout">
    								<td colspan="4">
    									<input type="checkbox" name="attendee[optout]" id="tribe-tickets-attendees-list-optout">
    									<label for="tribe-tickets-attendees-list-optout"><?php esc_html_e( 'Don\'t list me on the public attendee list', 'event-tickets' ); ?></label>
    								</td>
    							</tr>
    						<?php endif; ?>
    					</table>
    				</td>
    			</tr>
    			<tr>
    				<td colspan="4" class="add-to-cart">
    					<?php if ( $must_login ): ?>
    						<?php $login_url = Tribe__Tickets__Tickets::get_login_url() ?>
    						<a href="<?php echo $login_url; ?>"><?php esc_html_e( 'Login to RSVP', 'event-tickets' );?></a>
    					<?php else: ?>
    						<button type="submit" name="tickets_process" value="1" class="button alt"><?php esc_html_e( 'Confirm RSVP', 'event-tickets' );?></button>
    					<?php endif; ?>
    				</td>
    			</tr>
    			<?php
    		}
    		?>
    	</table>
    </form>
    
    <?php
    $content = ob_get_clean();
    if ( $is_there_any_product ) {
    	echo $content;
    	// If we have rendered tickets there is generally no need to display a 'tickets unavailable' message
    	// for this post
    	$this->do_not_show_tickets_unavailable_message();
    } else {
    	// Indicate that we did not render any tickets, so a 'tickets unavailable' message may be
    	// appropriate (depending on whether other ticket providers are active and have a similar
    	// result)
    	$this->maybe_show_tickets_unavailable_message( $tickets );
    }
    Barry

    (@barryhughes-1)

    Sounds like you managed to resolve this, which is great (and thanks for posting a new topic for this) ??

    If you do still need help and can share a URL we’d be happy to take a look so we can better verify if it might be a legitimate bug or not (it could after all be the result of a theme or plugin conflict of some kind).

    Thanks!

    Hi,

    I arrived to this thread following a fix to the first error mentioned here

    “Error: Please fill in the RSVP confirmation name and email fields”

    The rsvp.php file override posted here solved that problem. A confirmation message is displayed stating that the RSVP has been received, unfortunately seems that is not recorded as no mail is sent out to the user and the availability of tickets does not decrease.

    I am not able to find out where the problem is and would be grateful if someone aware of this issue could give some hint

    Regards,
    Andrea

    Barry

    (@barryhughes-1)

    Hi Andrea,

    Even where it seems like the same (or a very similar) problem, it’s generally best to create a fresh topic of your own.

    In doing so if you can summarize steps to replicate the problem as they apply to your site and perhaps some live example URLs, that would be awesome.

    Thanks!

    Hi,

    Where does the code above go in order to fix the issue?
    Does it go in function.php?

    Thank you

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘RSVP Error: Please fill in the RSVP confirmation name and email fields’ is closed to new replies.