Cancel RSVP Programmatically

Home Forums Ticket Products Event Tickets Plus Cancel RSVP Programmatically

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #1169935
    tjkelly
    Participant

    Hi there. I’ve read this— https://theeventscalendar.com/knowledgebase/refund-cancel-tickets-order/ —and this— https://theeventscalendar.com/support/forums/topic/rsvp-cancel/ —and a few other posts about canceling RSVPs.

    I understand how to do it via admin. And I understand that your plugin doesn’t offer a way right now.

    I want to build a way.

    Is there anything you can tell me about how to do that? Is it a matter of duplicating the functionality on the admin side?

    Something like…

    • Find Event ID, similar to: site.com/wp-admin/edit.php?post_type=tribe_events&page=tickets-attendees&event_id=XXX
    • Look through RSVP Orders for that event, find one matching current user ID
    • Confirm “do you really want to cancel?” and if yes, perform delete of that order (is that just a status=trash change?)

    That’s what it looks like. Am I on the right track?

    Thanks

    #1170377
    Cliff
    Member

    Hi TJ.

    Thanks for your question.

    If I understand you correctly, you’re wanting to “refund” / re-stock RSVP tickets.

    As you know, this is not currently possible.

    Regarding making your own, you should probably look through

    • /wp-content/plugins/event-tickets/src/Tribe/RSVP.php
    • /wp-content/plugins/event-tickets/src/Tribe/Tickets.php

    I hope this helps.

    If you want, you could also submit a pull request to https://github.com/moderntribe/event-tickets

    You might also want to look through the existing Event Tickets / Event Tickets Plus feature requests for additional ideas and others who may want to help you with this.

    Please let me know if you have any follow-up questions.

    #1170598
    tjkelly
    Participant

    I’ll check out the git repo and files you’ve listed, thank you.

    Tickets are free, so refund isn’t an issue. And I’m not terribly worried about restocking the cancelled spot. Only interested in removing the attendee from the list.

    Based on that, am I on the right track (with the process I’ve described above)?

    #1170696
    Cliff
    Member

    If I’m understanding what you want, you could just update a user’s RSVP from “Going” to “Not Going” with this code:

    update_post_meta( $id, Tribe__Tickets__RSVP::ATTENDEE_RSVP_KEY, 'no' );

    And then your Attendee Report could just exclude ones that are “Not Going”

    I hope this points you in the right direction.

    #1170699
    tjkelly
    Participant

    Thank you! Leaving this unresolved until testing.

    #1170713
    Cliff
    Member

    Sure thing.

    Please note that threads get Closed automatically after a couple weeks of inactivity. If it does get Closed, please open a new thread, adding your current problem description and also linking back to this thread.

    Thank you!

    #1180700
    Support Droid
    Keymaster

    Hey there! This thread has been pretty quiet for the last three weeks, so we’re going to go ahead and close it to avoid confusion with other topics. If you’re still looking for help with this, please do open a new thread, reference this one and we’d be more than happy to continue the conversation over there.

    Thanks so much!
    The Events Calendar Support Team

Viewing 7 posts - 1 through 7 (of 7 total)
  • The topic ‘Cancel RSVP Programmatically’ is closed to new replies.