Support

Home Forums Event Espresso Premium EE4 Event Tickets & Datetimes confusion

EE4 Event Tickets & Datetimes confusion

Posted: September 13, 2017 at 5:23 am

Viewing 7 reply threads


Debbie B

September 13, 2017 at 5:23 am

I need to be able to have people select a timeslot of an event and also choose a ticket type but I don’t want 20 different ticket types to appear on the screen.

Is there a way to have a person select say a time slot and then have the ticket types pop up? Because I have 2 different ticket types (say General Admission and Special Admission) and up to 20 timeslots for this event.

Thank you,
Debbie


Tony

  • Support Staff

September 13, 2017 at 5:35 am

Hi Debbie,

Your time slots would be datetimes however you would need a set of tickets for each of those timeslots.

Datetime A – Admission Ticket
Datetime A – Special Admission
Datetime B – Admission Ticket
Datetime B – Special Admission

and so on for each datetime (click the cog on the ticket to select which datetime the ticket is for).

What you can then do is change the settings within Event Espresso -> Events -> Templates -> Ticket Selector Template Settings

You’ll find the option ‘Show Date & Time Filter?’ which allows you to setup if a datetime file should show and ‘Date & Time Filter Threshold’ to determine how many datetimes the event needs to have before that shows.

If you set that up so the threshold is just below the amount of datetimes you have on the event it will add a dropdown to the ticket selector for your users to select a datetime, then only tickets for that datetime show on the ticket selector.

Will that work?


Debbie B

September 13, 2017 at 6:01 am

That mostly works. Is there a way to have the filter not have any dates/times selected at first?


Josh

  • Support Staff

September 14, 2017 at 11:49 am

yes, there is and it involves adding some PHP and JavaScript code to your website. Here’s an example of some code that will uncheck all the options and hide all the tickets until a datetime is checked:

add_action( 'wp_enqueue_scripts', 'my_ee_change_datetime_selector_default_unchecked', 11 );
function my_ee_change_datetime_selector_default_unchecked() {
  wp_add_inline_script( 
    'ticket_selector',
    'jQuery(document).ready(function ($) {
      var $datetime_options = $(".datetime-selector-option"),
      $ticket_selector_rows = $(".tkt-slctr-tbl").find(".tckt-slctr-tbl-tr");
      if( $($datetime_options).length) {
        $ticket_selector_rows.addClass("ee-hidden-ticket-tr");
        $.each($datetime_options, function () {
         $(this).prop("checked", false);
        } );
      }
    } );'
  );
}

You can add the above to a functions plugin or into your WordPress theme’s functions.php file.

  • This reply was modified 7 years, 2 months ago by Tony. Reason: Code update


Debbie B

September 14, 2017 at 9:29 pm

hmmmm when I put that code in and select a date/time and then a ticket, when I hit the Register Now button I get:

An error has occurred:
You need to select a ticket quantity before you can proceed.

It appears to remove any selection I make….


Tony

  • Support Staff

September 15, 2017 at 2:55 am

The code above has been updated to remove this line:

.find(".ticket-selector-tbl-qty-slct").val(0)

Try that updated version and see if that works for you.


Debbie B

September 15, 2017 at 7:20 am

Perfect! That worked. Thank you!


Tony

  • Support Staff

September 15, 2017 at 7:35 am

You’re most welcome

Viewing 7 reply threads

The support post ‘EE4 Event Tickets & Datetimes confusion’ 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