Support

Home Forums Event Espresso Premium Hiding questions based on ticket types

Hiding questions based on ticket types

Posted: December 11, 2019 at 8:59 am


Phil Wildcroft

December 11, 2019 at 8:59 am

I want to do something similar to this poster – https://eventespresso.com/topic/questions-specific-to-ticket-types/. The answer from Tony says “On the Single Page CheckOut (SPCO for short) the ticket ID is added to each individual attendee panel …”

But what I’m finding is that’s only true if there are multiple tickets in the basket, i.e, the class isn’t “spco-attendee-ticket-25” but “spco-attendee-ticket-single” if there’s only one ticket. So it’s not possible to target a question for hiding based on ticket type because it’s not possible to identify the ticket type.

Is there any way around that? Can I force the ticket type to be part of the class even if there’s only a single ticket?

Thanks,
Phil


Josh

  • Support Staff

December 11, 2019 at 8:29 pm

Hi Phil,

Thanks for the writing out the details. What we can do is in the next update include a change to the template so the class will be
“spco-attendee-ticket-25”
instead of
“spco-attendee-ticket-single”

It’s a really small change so if you want to make that change now on your site (before the update) you can open up
modules/single_page_checkout/reg_steps/attendee_information/attendee_info_single.template.php

and on line 31 change this:

class="spco-attendee-panel-dv spco-attendee-ticket-single">

to this:

class="spco-attendee-panel-dv spco-attendee-ticket-<?php echo key($template_args['ticket_count']); ?>">

Normally you would lose the change on an update, but in this case the next version should have a similar change there.


Phil Wildcroft

December 12, 2019 at 3:32 am

Hi Josh,

I’ve made the change and it’s all working.

Do you think it would be a good idea to add “spco-attendee-ticket-25” (or whatever) as an extra class in case anybody is already targetting “spco-attendee-ticket-single”?

Thanks,
Phil


Josh

  • Support Staff

December 12, 2019 at 7:05 am

Hi Phil,

I had thought about it but decided it wasn’t needed because that particular template was introduced in the most recent release of EE4. So it’s been in the wild for only a few weeks. More than likely no one is using that class.

Also, going forward if someone wanted to target div they could do so without that class.


Phil Wildcroft

December 12, 2019 at 7:25 am

Fair enough, I didn’t realise it was a recent addition.

The support post ‘Hiding questions based on 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