Support

Home Forums Event Espresso Premium Permission code required to register

Permission code required to register

Posted: September 2, 2016 at 1:18 pm

Viewing 19 reply threads


Nancy

September 2, 2016 at 1:18 pm

I am setting up an event that has various tickets for a course (5 day, 3 day, and 2 day). In order to register for the 2-day course the registrant needs to obtain permission from the teacher. Do you know of a way to do this with Event Espresso? I was thinking that the teacher would have a code that they could give to the registrant to use when registering. Maybe if there is a way to customize the Attendee Information page and assign it to just the 2-day registration then a required field could be added for the code. Is this possible or is there another better way?
thanks.


Josh

  • Support Staff

September 2, 2016 at 1:40 pm

You can set the event to be password protected in the Event editor’s Update Event box.


Nancy

September 2, 2016 at 2:19 pm

That is not ideal for this situation since only the 2-day course needs permission. Is there any other way?

If not then I could create a separate event for the 2-day course but and make that password protected. However, it would be confusing to see this listed on the events page. Is there a way to keep that event from appearing on the events page?


Josh

  • Support Staff

September 2, 2016 at 2:46 pm

Another way involves a bit of custom coding, but it’s fairly straightforward. Basically you set up a password protected page for that ticket only. Here’s a link to a code example:

https://github.com/eventespresso/ee-code-snippet-library/blob/master/templates/jf_ee_password_protect_ticket.php

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


Nancy

September 2, 2016 at 3:38 pm

Thanks Josh. This is getting close to a workable solution. I will try one more tweak request on this.

After doing what you recommended then the 2-day option no longer shows up on the main event page in the listing of available tickets. We could put it in a note below in the description but it would be better if the 2-day course also showed up in the table of ticket options.

I can duplicate the 2-day course ticket so that it does show up but then we need to keep people from registering to it. (they need to use the link to the password protected registration). I can set the ticket availability to 0 but then it shows it as ‘Sold Out” which is not good. Is there another way to make a ticket not purchasable without it saying that it is sold out?


Josh

  • Support Staff

September 6, 2016 at 9:08 am

You can use this code example instead then:

https://github.com/eventespresso/ee-code-snippet-library/blob/master/templates/jf_ee_limit_ticket_options_password.php


Nancy

September 7, 2016 at 12:33 pm

this is close but now the password protected page has an issue. If I replace all of the code that you suggested in your first post with this latest code then all of the events appear on the password protected page.

If I just replace the first part of the new code but leave this line from the old code:
add_filter( ‘FHEE__ticket_selector_chart_template__do_ticket_entire_row’, ‘espresso_vip_tickets’, 10, 2 );

then on the password page I am just getting an empty table without any data showing up for the ticket. I just shows the table heading. here is the link. the password is “enter”
http://66.147.244.248/~ncmcmedi/2-day-test/

thanks.


Josh

  • Support Staff

September 7, 2016 at 12:40 pm

The example code actually needs to be altered to include the tickets IDs of the tickets that you’re going to hide or show. Did you update the code to include those? Maybe you can post the code to a paste bin or gist, then link here to that code and I can take a look at that.


Nancy

September 7, 2016 at 12:49 pm

Update. I had to remove that line of code “add_filter” because it was breaking the table on the main event (non-password protected page). So now f you go to that link then you will probably see all of the tickets listed. We would like it to just list the single ticket.

And to add a wrinkle. I am trying to create an add on for course credit. So this option would also be needed to appear on the password page. (can I list two $VIP_Post_ID numbers?)

again, thank you for your support


Nancy

September 7, 2016 at 1:05 pm

Yes I updated the ticket id and post id. this shows that code: http://pastebin.com/2fgnP7t2

This works correctly on the main page, inserting the text in place of the ticket that needs a password. But on the password page all of the tickets are showing, instead of just the one ticket.

If I add back in the filter code from your first post then it breaks both ticket listings. Here is the code with the extra line at the end that breaks it. It did work with the first code you sent, just not the current.
http://pastebin.com/s49taQkn


Josh

  • Support Staff

September 7, 2016 at 2:22 pm

The possible reason for the breakage is because the code from the two different examples shouldn’t be mixed together. You can take a closer look at the two different code examples and you’ll see that one hooks into:
FHEE__ticket_selector_chart_template__do_ticket_inside_row
and the other hooks into
FHEE__ticket_selector_chart_template__do_ticket_entire_row
Each filter expects different return values, the former expects html for the inside of the table row, the latter expects the html for the entire table row.

So since they do two different things, you’ll probably need to set up two functions, one function for removing ticket rows from the display, based on this example code:
https://github.com/eventespresso/ee-code-snippet-library/blob/master/templates/jf_ee_password_protect_ticket.php

Then another function for changing the display of the ticket row, based on this example:
https://github.com/eventespresso/ee-code-snippet-library/blob/master/templates/jf_ee_limit_ticket_options_password.php


Nancy

September 7, 2016 at 3:22 pm

With this update the filter is working properly on the password page. But the listing text on the main page is not showing up. here is the code with both as I inserted it.

http://pastebin.com/ugQCajvg

When I just load your second bit of code then the listing text does appear. However, obviously, the password page is showing all listings.

there seems to be some kind of conflict.


Josh

  • Support Staff

September 7, 2016 at 6:29 pm

The code is doing exactly what it’s supposed to be doing. Where you have the conditional in that espresso_vip_tickets function, there’s a part of that conditional that does this:

( $post->ID != $VIP_Post_ID && $ticket->ID() == $VIP_Ticket_ID ) ||

What that code does is basically the same thing as “if this isn’t the password protected page, and this ticket is the special restricted ticket, then don’t show this ticket’s row OR” and another conditional follows.

So to make it show the html for the special restricted ticket on the regular event page, you remove the above code.


Nancy

September 8, 2016 at 10:34 am

Thank you. that did the trick.

Since you have stuck with me this far, could I ask one more related question?

In addition to the course registration they will offer, for an additional charge, the option of taking the course for credits towards a certification. To do this I will just create an extra ticket for the credit option.

This “credit” ticket should appear on the main event page with all the others. But it should also appear on the password page along with the 2-day option.

Could you please tell me how to modify the code to include the additional ticket on the password page?

thanks.


Nancy

September 12, 2016 at 4:41 pm

Hi, Just bumping this question up again incase it got overlooked. Thanks.


Josh

  • Support Staff

September 14, 2016 at 1:22 pm

What you could do is set one more variable for the ticket that you want to be displayed everywhere, e.g.
$everywhere_ticket_id = 12;

Then, before the return value gets modified, you add one more conditional to check for that ID and if there’s a match, you return with the unmodified return value, e.g.

if ( $ticket->ID() == $everywhere_ticket_id ) {
  return $ticket_row_html;
}


Nancy

September 14, 2016 at 3:21 pm

thanks Josh. Unfortunately this php is a little over my head. could you please tell me where I should place these two new lines?

Here is my current code:
http://pastebin.com/K94B88Mp


Josh

  • Support Staff

September 14, 2016 at 4:13 pm

You’ll put the new code inside the espresso_vip_tickets function, before the line that starts with if.


Nancy

September 15, 2016 at 10:55 am

thank you Josh, that worked. I am not sure if this is a common enough issue but it seems useful to have something like this built in. especially the ability to create a ticket and then check a box where it is not available for sale (but reads some custom text instead of sold out). It that were the case then all of this could be done with categories maybe. Anyway, thanks a lot.


Josh

  • Support Staff

September 15, 2016 at 11:12 am

It’s not a common enough issue to warrant building out an entire UI for this. That said, if a developer wanted to build an add-on that were to add a feature set to extend the ticket editor to make all this happen within the ticket editor, it’s totally possible.

Viewing 19 reply threads

The support post ‘Permission code required to register’ 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