• Resolved agenziae20

    (@agenziae20)


    Hi,

    how can I completly remove the ticket options form (the one that shows up when I tick “Enable registration for this event” checkbox in event submission form)?

    This data are unuseful to me and just misleading for the event manager, I just want user to click a button and register/unregister to an event (something similar to facebook events).

    This plugin is really well done and has tons of options but couldn’t find a way to remove the ticket options form.

    Thanks.

Viewing 7 replies - 1 through 7 (of 7 total)
  • Hi,
    EM user here too.

    I just want user to click a button and register/unregister to an event (something similar to facebook events).

    Unlike Facebook, EM is an actual event planner. So for real events (unlike virtual events that Facebook publishes), EM needs a maximum amount of tickets/seats/spaces. No true real-life event as an unlimited capacity, of course.
    If you do not enable registration, EM has no way of registering any participants and you will have no clue how busy it is going to be that day. ??

    This data are unuseful to me

    Not quite true. Because you do want an “I am attending”-button, registration (although in a slimmed down form, perhaps) is on your wishlist. ??

    So, you do need some sort of registration, but basically what you are asking is:
    “Can I set the registration to a default (free price, and a high number of tickets) and then hide it?” Am I right??? ??

    Well… Yes and no. ?? You can, but you will need some custom coding to do that. EM has a php filter to set the default ticket data. Then, using jQuery you can hide the metabox from the Admin view.

    Let me know if this is indeed what you actually would like to achieve.

    Thread Starter agenziae20

    (@agenziae20)

    Hi Patrick,
    thank you for your kind reply.

    You are right, for real events you need those information, but actually I don’t need them because I would like to use EM for some sort of temporary job offer, I just need to know which ones of the registered users is available for that job on that date and then I can choose among the candidates.
    So I don’t need to set a maximum number of seats (the more candidates I have, the better) and of course I don’t charge people to candidate for a job ??

    And since it is a temporary job (few days) i guess that an event plugin is more suitable than a real job offers plugin.

    If there is any workaround to achieve that, I will try it.

    “Events” are submitted from frontend, then I need to hide those ticket options fields from the frontend event submit form, not from the admin backend.

    Thanks for your help.
    Regards.
    Gab

    Hi Gab,

    Events Manager was not build to handle virtual events, so technically you do need a maximum. ?? Here’s the workaround.

    First, let’s create that default, free ticket and set the number of available applicants to 1000. (increase the number if you want even more, hehehehe).

    Add this to your functions.php

    function em_create_free_default_ticket($EM_Ticket) {
      if ( empty($EM_Ticket->ticket_id) ) {
        $EM_Ticket->ticket_name = 'Available';
        $EM_Ticket->ticket_spaces = 1000;
        $EM_Ticket->ticket_description = '';
        $EM_Ticket->ticket_price = 0;
        $EM_Ticket->ticket_min = 1;
        $EM_Ticket->ticket_max = 1;
      }
    }
    add_filter('em_ticket', 'em_create_free_default_ticket', 10, 2);

    That will set the default ticket in every new event to this:
    https://paste.pics/93b90f82c36dba1db6f6ab19e58a6c79

    Now, we need to hide that complete section from the view in the front-end event submission form, right? Add this also to your functions.php file:

    function em_hide_ticket_options_in_frontend_submission($EM_Event) {
      ?><script>
      jQuery.noConflict();
        jQuery(document).ready(function() {
          // Automatically check the checkbox to allow registrations. Disable it to prevent any changes.
          jQuery('#event-rsvp').prop('checked', true).attr('disabled', 'disabled');
    
          // Hide the <h3>Bookings/Registration</h3>
          jQuery('.event-form-bookings').prev('h3').hide();
    
          // Hide the rest of the Ticket Form.
          jQuery('.event-form-bookings').hide();
        });
      (jQuery);
      </script><?php
    }
    add_action('em_front_event_form_footer', 'em_hide_ticket_options_in_frontend_submission');

    Tada! ??
    Now, up to 1.000 applicants can click the Submit Button in the booking/application form to tell you they are available. In the Admin you can manage these entries as “normal” bookings.

    Because we set both the min and max number of tickets to 1, EM will automatically recognize that the spaces dropdown makes no sense. So, it’s hidden from the actual booking form.

    The default ticket will also be created for the Admin, but the metabox will still be shown and the checkbox will not be disabled.

    Let me know if this works.

    Thread Starter agenziae20

    (@agenziae20)

    Hi Patrick,

    thank you for your great help!
    This code works, it hides all tickets options fields but unfortunately if I add a new event, bookings are disabled.
    To activate bookings I had to edit the event from backend. ??
    Do you know how I can fix it?

    Hmmmm…
    What happens when you replace
    jQuery('#event-rsvp').prop('checked', true).attr('disabled', 'disabled');

    with
    jQuery('#event-rsvp').prop('checked', true);

    Thread Starter agenziae20

    (@agenziae20)

    IT WORKS!!!

    Thanks a lot! ??

    My pleasure! Enjoy ??

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘how to remove ticket options block’ is closed to new replies.