Events made easy – remove the seats field

Events made easy is a plugin for WordPress that enables you to build a booking system, which can be used for booking sessions or events with customers. There is some fields on the registration form that is required, e.g. name, e-mail, phone etc.

Another field that is required is a field where the customer can choose the amount of seats for the booking that they want for the event. If the customer can only choose one seat, because this is the only option in the type of event they are booking, it does not make sense to show the field, because the value is always one.

Unfortunately there is no build-in option to hide the field. When you try to remove it from the template, your registration form will not be showed, because a required field is missing. In this article I will show a work-around you easy can use to hide the field seats in events made easy.

Edit the file events-made-easy/eme_formfields.php

First we have to change in the settings of events made easy, so it does not hide the registration form when we remove the field from the template. Here is how you do:

  1. Open Plugins -> Editor -> Choose the field: events-made-easy/eme_formfields.php
  2. Find the line $required_fields_count = 0; and change this to:$required_fields_count = 1;
  3. Find the line $bookedSeats=0; and change this to:$bookedSeats=1;
  4. Save the file.

Edit the template

Then you have to change the template so the field is not there anymore.

  1. Open Events -> Settings -> RSVP
  2. Go to the bottom and remove the following line in the template:

    <tr><th style=’background-color:white;color:#000000;border:0px;’>Seats:</th><td>#_SEATS</td></tr>

  3. Then add the following line:

    <input type=”hidden” id=”bookedSeats” name=”bookedSeats” value=”1″>

  4. Save the template

This should do the trick. The last line you have added is a hidden field where the value is the standard value for the amount of seats. We cannot avoid this hidden field, because events made easy has to know how many seats that are taken. But this field will not be showed for the customers.

Download Events made easy here

0 0 votes
Article Rating

Andreas Andersen

Forfatter og grundlægger af IT-blogger.dk, der har blogget om IT-emner siden 2012. Findes på Mastodon på @aphandersen@ansico.dk

Abonner
Giv besked ved
guest

1 Comment
mest stemt på
nyeste ældste
Inline Feedbacks
View all comments
Franky siger:

Hi,

I’m the developer of Events Made Easy. Although your workaround should work fine, I think there’s a much easier solution:
just set the min and max seats to book for that event to 1 and then use CSS to hide the field bookedSeats (or the row-id containing it, depending on your RSVP template). No source code needs to be changed for this.

Franky

1
0
Would love your thoughts, please comment.x
()
x