Remove booking from bookings table on cancellation

WordPress Event Management, Calendars & Registration Forums Request A Feature Remove booking from bookings table on cancellation

This topic contains 2 replies, has 2 voices, and was last updated by  Stephen Harris 10 years, 7 months ago.

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #10718

    I cancelled a booking today, and it was removed from wp_posts but not wp_eo_booking_tickets. I need to use eo_booking_tickets in order to know what event I am looking for bookings for, but I need the record in wp_posts in order to know who the booking was created by/who it is for. So if I cancel the booking, my code still thinks someone is booked for the event, but can’t find any results in wp_posts when it passes the booking_id’s found from eo_booking_tickets.

    Gabriel David
    #10719

    And for verification, I used the cancel button from the admin panel, not a custom coded function or call to eo_cancel or eo_delete

    Gabriel David
    #10734

    Hi Gabriel,

    I’m not sure why you can’t find the bookings in the post table, but ‘Cancelled’ bookings are not removed from either *_posts or *_eo_booking_tickets. Also as a general rule you shouldn’t query eo_booking_tickets on its own, as there is no indication as to the status of the booking.

    You can use eo_get_bookings(), though, to retrieve bookings matching a query and then eo_get_booking_tickets() to get the tickets by booking ID (or an array of booking IDs).

    Details are on the codex, but eo_get_bookings() allows you to query bookings by ‘status’. This can be a string or array of statuses. It defaults to ‘any’. Where custom statuses might be used you can use these functions to retrieve all registered booking statuses (or those which a considered ‘confirmed’, or those for which spaces are reserved).

    Does that help?

    Stephen Harris
Viewing 3 posts - 1 through 3 (of 3 total)
To enable me to focus on Pro customers, only users who have a valid license for the Pro add-on may post new topics or replies in this forum. If you have a valid license, please log-in or register an account using the e-mail address you purchased the license with. If you don't you can purchase one here. Or there's always the WordPress repository forum.