• Resolved XCTrails

    (@xctrails)


    Hi,

    I have a requirement to set a category or role for a user once a booking is confirmed (or revoked). So I tried to hook into em_booking_set_status hook, but the problem there is, that the EM_Booking object which is passed into my action has a reference (via get_person()) to the user who confirmed or revoked the booking but not to the actual user who booked the ticket. So far, I haven’t found a way to get that person from the booking object, any ideas how to do that?

    Thanks,
    Armin

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Support angelo_nwl

    (@angelo_nwl)

    maybe you can try to use wordpress current login user? since normally the current login user with the admin rights can manage the events or bookings. also, to get the event owner you can try something like $EM_Booking->get_event()->get_contact()->display_name

    Thread Starter XCTrails

    (@xctrails)

    Thanks, maybe I wasn’t clear enough in my question. Actually, I need the user who booked the event. i.e. neither the current login user (this would be an admin who confirms or denies a booking nor the event owner.

    Thread Starter XCTrails

    (@xctrails)

    Ok, $EM_Booking->person_id holds the ID of the user who made the booking, $EM_Booking->get_person() returns the user who confirmed/denied/etc. the booking.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘User for booking in em_booking_set_status hook’ is closed to new replies.