Display Event Meta in Booking History

WordPress Event Management, Calendars & Registration Forums General Question Display Event Meta in Booking History

This topic contains 1 reply, has 2 voices, and was last updated by  Stephen Harris 10 years, 8 months ago.

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #7029

    I want to be able to display some event meta (such as category, img etc..) in the booking history.
    So far im just running into brick walls…
    I have used the booking-history as a template but need to be able to pull the event_id (as a number) and use it with eo_get_booking_meta.

    Any pointers will be very much appreciated

    Omayr McAdam
    #7032

    Hi Omayr,

    You can get the event (post ID) corresponding to the booking with:

    $event_id = eo_get_booking_meta( $booking_id, 'event_id' );
    

    (codex). In the booking-history template you can get the $booking_id from get_the_ID() or $post->ID. If you are selling tickets by date and want to get the occurrence booked;

    $occurrence_id = eo_get_booking_meta( $booking_id, 'occurrence_id' );
    

    This is 0 if booking by series. You can then use $event_id (and $occurrence_id) in the various event functions. Things like featured image and category can be retrieved used $event_id and the standard WordPress functions:

    Stephen Harris
Viewing 2 posts - 1 through 2 (of 2 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.