Add custom booking status

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

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #39739

    Hello Stephen,
    I have question about possibility to define custom statuses of bookings. Generally I have course registration and sometimes the participants not finish the course in defined period so we have to invite him to post course.
    For me will be very usefull if I can define custom booking statuses like “Course started” “Course completed”. Is there some way to do it?

    Thanks a lot Kamil
    
    Kamil Konečný
    #39761

    Hi Kamil,

    Yes you can register custom booking statuses. The function is essentially a wrapper for register_post_status (https://developer.wordpress.org/reference/functions/register_post_status/)., but with two additional flags: whether the status should be considered “confirmed” (i.e. the booking is confirmed) and whether it should “reserve” spaces (e.g. depending on setttings, the ‘pending’ status might reserve bookings but such a booking is not considered confirmed).

    add_action('init', function(){
    
        if (!function_exists('eo_register_booking_status')) {
            return;
        }
    
        eo_register_booking_status('course_strated', array(
            'label' => "Course started",
            'include_in_confirmed' => true,
            'reserve_spaces' => true,
            'show_in_admin_all_list' => true,
            'show_in_admin_status_list' => true,
        ));
    
    });
    

    However, please note that there appears to be an issue in that custom statuses aren’t picked up on the bookings admin page filter. I’ll look into that.

    Stephen Harris
    #39766

    Thanks a lot Stephen,
    If you will find how to filter bookees by the custom statuses it will be very helpfull for us.

       Have a nice day Kamil
    
    Kamil Konečný
    #39775

    That should be fixed in the next version of Pro (3.3.0), which I’ll release later this week.

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