Home › Forums › Ticket Products › Event Tickets Plus › Cancel RSVP Programmatically
- This topic has 7 replies, 4 voices, and was last updated 9 years, 5 months ago by
tjkelly.
-
AuthorPosts
-
September 28, 2016 at 10:43 am #1169935
tjkelly
ParticipantHi 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
September 29, 2016 at 8:00 am #1170377Cliff
MemberHi 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.
September 29, 2016 at 10:50 am #1170598tjkelly
ParticipantI’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)?
September 29, 2016 at 2:02 pm #1170696Cliff
MemberIf 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.
September 29, 2016 at 2:06 pm #1170699tjkelly
ParticipantThank you! Leaving this unresolved until testing.
September 29, 2016 at 2:29 pm #1170713Cliff
MemberSure 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!
October 21, 2016 at 9:35 am #1180700Support Droid
KeymasterHey 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 -
AuthorPosts
- The topic ‘Cancel RSVP Programmatically’ is closed to new replies.
