Support

Home Forums Event Espresso Premium No Multiple Attendees

No Multiple Attendees

Posted: October 8, 2013 at 10:59 am


Sarah Rogers

October 8, 2013 at 10:59 am

Hi there,

I’m selling tickets for events where a child can get in for free, but we still need to count them. I’ve set up two price points, and forced the the registration form to go straight to the cart. However, once you are in the cart, it requires Attendee information from two people – the first from the general admission ticket, and the next from the free ticket. Is there a way to hide the additional Attendee information. (Can’t do it with CSS, since the information is required…)

http://kindragoehler.com/mbi/funny/event-registration/?regevent_action=register&event_id=155&name_of_event=All%20Ages%20Show

Thank you.


Josh

  • Support Staff

October 8, 2013 at 12:44 pm

Hi Sarah,

There is a way to hide the second ticket type’s registration form. Along with that, the fields will need to be copied over (or the registration validation will fail as you’ve noted). It turns out jQuery can do both of these tasks with minimal coding involved.

I put together some example jQuery code that’s based on how you’re trying to use the multi-checkout. What it will do is copy the entries for first name, last name, and email from the first registration form to the fields in the additional forms. It will also hide the additional forms.

jQuery(document).ready(function($) {

	var $notfirstfname = $('.fname').not(':first')
	$('.fname:first').keyup(function() {
		$notfirstfname.val ( this.value );
	});
	var $notfirstlname = $('.lname').not(':first')
	$('.lname:first').keyup(function() {
		$notfirstlname.val ( this.value );
	});
	var $notfirstemail = $('.email').not(':first')
	$('.email:first').keyup(function() {
		$notfirstemail.val ( this.value );
	});

	$('.multi-reg-page').not(':first').css('display', 'none');

});

The above code can be placed in a file named mycustom.js and placed in the /wp-content/uploads/espresso/ folder on your server.
It will need to load up on the registration page, and this function can be placed into a file named custom_functions.php in the same folder to load up the custom script:

add_action('wp_enqueue_scripts', 'my_custom_espresso_scripts');

function my_custom_espresso_scripts() {
	global $load_espresso_scripts;

	if ( ! $load_espresso_scripts )
		return;
	// custom script located in /wp-content/uploads/espresso/
	wp_enqueue_script('my-custom-script', content_url('/uploads/espresso/mycustom.js'), array('jquery'), '1.0', true);
}


Sarah Rogers

October 14, 2013 at 12:02 pm

Hi Josh,

This worked perfectly, thank you so much!

The support post ‘No Multiple Attendees’ 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