Events Made Easy › Forums › Bug fixed or feature request implemented › Condition in the Registration form
- This topic has 6 replies, 2 voices, and was last updated 10 years, 6 months ago by Franky.
-
AuthorPosts
-
Fri 2 May 2014 at 17:17 #52100AnonymousInactive
Hi Franki
I have been testing the plugin and it works great so far. Keep up the good work.
I would however like to add in a condition in the Registration form. Let me try and explain.
When the invite is sent, an invite/event code is part of the email. EG: Event03
Now when the invitee responds and completes the online event registration they must enter this invite/event code with rest of the details.
If the invite/event code is correct then it should do the booking else reject it.
The invite/even codes will differ per event.
The CAPTCHA method must still also be available.I have searched the forum but can find anything related to this. I am sure it something very easy to do, just not finding the answer. I am sure that the Hooks And Filters is the place to start, but not quite sure how.
Sat 3 May 2014 at 00:10 #52102FrankyKeymasterI’m guessing you need to use a custom field (to ask for the code) and then use the filter eme_eval_booking_form_filter to evaluate.
See http://www.e-dynamics.be/wordpress/?cat=44 and http://www.e-dynamics.be/wordpress/?cat=41Sun 4 May 2014 at 09:18 #52117AnonymousInactiveHi Franki
Thanks for that feedback. I am no developer but do can some of the basic stuff. I have added the lines below to the themes function.php but get an error message that 2 arguments are missing. I am also am not sure what to add between {….} to do the check. Can you please give some advise?
I have create a form filed eventid (this is id 3) to do the validation
add_action(’eme_eval_booking_form_filter’,’do_my_stuff’);
function do_my_stuff($event, $booker) {
}Sun 4 May 2014 at 23:19 #52120FrankyKeymasterExample:
add_action(‘eme_eval_booking_form_filter’,’do_my_stuff’); function do_my_stuff($event, $booker) { // show all input // print_r($_POST); if ($_POST['the field i want'] == 'the value') { // eval is success return array(0=>1,1=>''); } else { // bad form entry return array(0=>0,1=>'try something else'); } }
Tue 6 May 2014 at 12:13 #52147AnonymousInactiveHi Franki
Thanks for this. It works so cool and displays the message as expected. There is however a problem I don’t seem to find why?
I get a message the flashes with the post info
“Warning: Missing argument 2 for do_my_stuff() in /home/theme/….. on line 26.”…..but it works as expected.Note: This option works fine, but it means that all events will have the same eventcode or I have to edit the the above code regularly.
My requirements are that we send invites for specific events and mange them accordingly.
Suggestion: Add an event code field where admin can enter a code. This make the event Code unique for each event and that can the be an external validation.Tue 6 May 2014 at 12:33 #52148FrankyKeymasterThe event id is unique:
$event['event_id'];
I also found why you get that warning. I need to move the action hook in the code, for now it is executed before the $booker variable is completed, so it is an empty var. I’ll update that this evening.
Tue 6 May 2014 at 19:34 #52155FrankyKeymaster -
AuthorPosts
- The forum ‘Bug fixed or feature request implemented’ is closed to new topics and replies.