• Resolved bhwarrior

    (@blackhatwarrior)


    Hi,

    Is it possible to mark a booking delivered when a customer with booking appears to attend an event? This way one can differentiate between the customer who attended an event & who didn’t after the event is over. Also, It makes it easy to process refund requests looking at the booking status.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Booking Activities Team

    (@bookingactivities)

    That’s interesting, thank you for your request!
    I have added this feature in the development schedule, but the development priority are set according to the number of requests.

    For now, you can add it with the API:
    Add this code in your child theme functions.php:

    /**
     * Add the "Delivered" booking status
     * @param array $labels_array
     * @return array
     */
    function my_theme_booking_states_labels_array( $labels_array ) {
    	$labels_array[ 'delivred' ] = array( 'display_state' => 'good',	'label' => __( 'Delivered', 'my_theme_text_domain' ) );
    	return $labels_array;
    }
    add_filter( 'bookacti_booking_states_labels_array', 'my_theme_booking_states_labels_array', 20, 1 );
    
    /**
     * Allow to manually change the "Delivered" booking status
     * @param array $labels_array
     * @return array
     */
    function my_theme_booking_states_you_can_manually_change( $status_array ) {
    	$status_array[ 'delivred' ] = __( 'Delivered', 'my_theme_text_domain' );
    	return $status_array;
    }
    add_filter( 'bookacti_booking_states_you_can_manually_change', 'my_theme_booking_states_you_can_manually_change', 10, 1 );
    
    /**
     * Flag the "delivered" booking status as active
     * @param array $status
     * @return array
     */
    function my_theme_active_booking_states( $status ) {
    	$status[] = 'delivered';
    	return $status;
    }
    add_filter( 'bookacti_active_booking_states', 'my_theme_active_booking_states', 20, 1 );
    
    /**
     * Allow only administrators to change a booking state to "delivered"
     * @param boolean $true
     * @param int $booking_id
     * @param string $new_state
     * @return boolean
     */
    function my_theme_booking_state_can_be_changed( $true, $booking_id, $new_state ) {
    	if( ! $true || $new_state !== 'delivered' ) { return $true; }
    	return current_user_can( 'bookacti_edit_bookings' );
    }
    add_filter( 'bookacti_booking_group_state_can_be_changed', 'my_theme_booking_state_can_be_changed', 20, 3 );
    add_filter( 'bookacti_booking_state_can_be_changed', 'my_theme_booking_state_can_be_changed', 20, 3 );

    Regards,
    Yoan Cutillas

    Thread Starter bhwarrior

    (@blackhatwarrior)

    I hope to see this feature in the next update. Thank you!

    • This reply was modified 6 years, 1 month ago by bhwarrior.
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Custom Booking Status – Delivered’ is closed to new replies.