One RSVP tickets per registered user

Home Forums Ticket Products Event Tickets Plus One RSVP tickets per registered user

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #1128819
    Arn van der Pluijm
    Participant

    Hi,

    I am trying to find out if I can make event tickets (plus) to work so that it is possible to rsvp 1 ticket per registered user.
    So far I’ve updated the rsvp.php template so that the attendee info is hidden and automatically filled with the current user’s data (name and email).

    I would like to include a check such ad user_has_rsvp() or fetch a list of the user’s ticket. If a user already has a ticket I want to hide the RSVP button and show a message such as ‘You have an RSVP for this event”.

    Could you give me some pointers where to start?

    Regards, Arn

    #1129157
    Andras
    Keymaster

    Hi Arn,

    Welcome to the forums!

    There is a function count_rsvp_attendees( $event_id, $user_id = null ) which might be able to help you. It is defined in the wp-content\plugins\event-tickets\src\Tribe\Tickets-View.php file (line 547).

    As an example it is implemented in wp-content\plugins\event-tickets\src\views\tickets\order-links.php.

    Let me know if this helps.

    Cheers,
    Andras

    #1129162
    Arn van der Pluijm
    Participant

    Great, that seems to work. It’s a good starting point.

    #1129165
    Arn van der Pluijm
    Participant

    I used:

    $view      = Tribe__Tickets__Tickets_View::instance();
    $post_id   = get_the_ID();
    $user_id   = get_current_user_id();
    $user_has_rsvp = $view->has_rsvp_attendees( $post_id, $user_id );

    to check if the current user has an rsvp for this event. It seems to work, thanks!

    #1129741
    Andras
    Keymaster

    Hi Arn,

    Great stuff, glad it helps, and thanks for sharing your solution!

    I am going to go ahead and close this ticket, but if you need help on this or something else please open a new one. We’ll be here. 🙂

    Cheers,
    Andras

    PS: If you like our plugin, we would be happy to receive a review in the wordpress.org repository. Thanks!

Viewing 5 posts - 1 through 5 (of 5 total)
  • The topic ‘One RSVP tickets per registered user’ is closed to new replies.