Support

Home Forums Event Espresso Premium Questions specific to ticket types

Questions specific to ticket types

Posted: March 13, 2017 at 9:27 am


jxh

March 13, 2017 at 9:27 am

I have an event with several ticket types, only some of which include a certain meal, and I need to ask those attendees for their meal choice (beef/chicken/fish); I need to make it required, for them, but invisible and blank-answer for everyone else.

There are several other support topics that ask how to make questions that are specific to only a few ticket types. One (https://eventespresso.com/topic/additional-questions-under-a-specific-ticket/) mentions doing this with CSS and JQuery; can you give us a little more detail about how that would work?

I did succeed in wrangling a code snippet for another problem I had (https://eventespresso.com/topic/ee4-price-modifier-via-questions/) so an answer at that level of detail would be ideal. Thanks!


Tony

  • Support Staff

March 17, 2017 at 11:32 am

Hi there,

The reason there aren’t many details in the post is it’s not something we can provide support for and is unique for each situation as it stands so providing an example will require significant customization for each user to allow it work correctly.

We do have plans to add conditional logic to our registrations forms but providing workarounds that require a high level of customization for each user to use is not viable from a support perspective.

You can’t set questions at the ticket level, they are applied to the event which means that any ticket selection made on an event will always ask the same questions.

On the Single Page CheckOut (SPCO for short) the ticket ID is added to each individual attendee panel, for example – http://take.ms/uqSjp

The text spco-attendee-ticket- is prefixed to the ticket ID each time so that panel applies to the ticket with id 2.

So what you can do is is use jQuery to select the meal question and show it only only the panels with the specific ticket ID’s that need it, otherwise either set it not to be required or assigned a blank value you it.

Short of providing the code to do this there isn’t really a more in depth example I can give you, if you are unsure and the above feautre is critical for your events I’d recommend contacting a developer to add this for you, we have a list of some developers familiar with Event Espresso here:

https://eventespresso.com/developers/event-espresso-pros/


jxh

March 17, 2017 at 11:40 am

That’s good, thanks. I discovered this the hard way and had to learn jQuery from scratch, but it works! Here’s a concrete example for the next viewer. (My question group ID happens to be about a “meal”, and it applies to 4 of my ticket types but not all of them.)

jQuery( document ).ready( function( event ){
	function hideMeal(item, index) {
		jQuery( '.spco-attendee-panel-dv.spco-attendee-ticket-' + item ).
		find( '#ee-reg-form-qstn-grp-meal' ).hide();
	};
	['3', '5', '6', '16'].forEach(hideMeal);
} );

Looks easy, dunnit?


Tony

  • Support Staff

March 17, 2017 at 11:59 am

Nice job, and it sure does.

How are you adding that code into the checkout?

Using wp_add_inline_script? If not we have an example of how you can tag that script to SPCO here:

https://gist.github.com/joshfeck/e81ecac2a9654dbcd8f36ca5310e3cb0


jxh

March 17, 2017 at 1:01 pm

I spread it over my entire WP site, perhaps unnecessarily. In my (child) theme’s functions.php:

function theme_js() {
	wp_enqueue_script( 'theme_js', get_stylesheet_directory_uri() . '/js/custom.js', array( 'jquery' ), '1.0', true );
}
add_action('wp_enqueue_scripts', 'theme_js');

I will consider using your more-targeted approach, thanks!


jxh

March 17, 2017 at 1:08 pm

Tony, I’d like to share with you all my notes about using EE4 for my event, for feedback to your developers mostly (I’ve got it all to work, more or less) but don’t want to put it in the ticket for all to see. Not yet. Can you contact me directly? My email address should be in my profile.


Tony

  • Support Staff

March 17, 2017 at 2:04 pm

Sure, I’ve emailed you directly using the email address set on your current account.

The support post ‘Questions specific to ticket types’ 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