Viewing 3 replies - 1 through 3 (of 3 total)
  • Hi,

    Sorry, that’s not possible by default. It might be something you can do with custom coding.

    Thread Starter megabait12

    (@megabait12)

    Partly, I decided this problem by writing few filters

    function custom_bookings_table_cols_template() {
        return array(
            'user_name' => __('Name', 'dbem'),
            'first_name' => __('First Name', 'dbem'),
            'last_name' => __('Last Name', 'dbem'),
            'event_name' => __('Event', 'dbem'),
            'event_date' => __('Event Date(s)', 'dbem'),
            'event_time' => __('Event Time(s)', 'dbem'),
            'user_email' => __('E-mail', 'dbem') . '<br /><input name="booking_search" type="text" value="" placeholder="Booking search"/>',
            'dbem_phone' => __('Phone Number', 'dbem'),
            'booking_spaces' => __('Spaces', 'dbem'),
            'booking_status' => __('Status', 'dbem'),
            'booking_date' => __('Booking Date', 'dbem'),
            'booking_price' => __('Total', 'dbem'),
            'booking_id' => __('Booking ID', 'dbem'),
            'booking_comment' => __('Booking Comment', 'dbem')
        );
    }
    
    add_filter('em_bookings_table_cols_template', 'custom_bookings_table_cols_template', 99);
    
    function custom_get_default_search($array_or_defaults = array(), $array = array()) {
        $defaults = array(
            'status' => false,
            'person' => true, //to add later, search by person's bookings...
            'blog' => get_current_blog_id(),
            'ticket_id' => false,
            'booking_search' => false
        );
        // sort out whether defaults were supplied or just the array of search values
        if (empty($array)) {
            $array = $array_or_defaults;
        } else {
            $defaults = array_merge($defaults, $array_or_defaults);
        }
        //figure out default owning permissions
        if (!current_user_can('edit_others_events')) {
            $defaults['owner'] = get_current_user_id();
        } else {
            $defaults['owner'] = false;
        }
        if (EM_MS_GLOBAL && !is_admin()) {
            if (empty($array['blog']) && is_main_site() && get_site_option('dbem_ms_global_events')) {
                $array['blog'] = false;
            }
        }
        $parent = new EM_Object();
    
        return $parent::get_default_search($defaults, $array);
    }
    
    add_filter('em_bookings_get_default_search', 'custom_get_default_search', 10, 2);

    But now stuck with em_bookings_build_sql_conditions, can’t add custom search conditions

    function custom_build_sql_conditions($args) {
        if ($args['custom_search']) {
            return $conditions['custom_search'] = 'booking_id=' . $args['booking_search'];
        }
    }
    
    add_filter('em_bookings_build_sql_conditions', 'custom_build_sql_conditions', 10);

    Could you help me?

    Plugin Support angelo_nwl

    (@angelo_nwl)

    sorry but we are limited with regards to custom coding as per the support policy since this is not yet available by default

    https://eventsmanagerpro.com/support-policy/

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Backend booking search’ is closed to new replies.