Missing important information field on Staff

👍 Gathering votes

How can we effectively showcase the comments field for staff members during the booking phase?
It is crucial to incorporate a designated field where pertinent information such as staff experience can be inputted for client visibility. Your consideration on this matter would be greatly appreciated.

Anonymous

1 year ago

Activity
Nicholas

I was able to accomplish this since I needed more info on the staff members to be displayed. I did the following. Basically I am using the text within the staff notes to output more details for the user. I am pretty certain this is everything but if you test it and I missed something let me know. Also, you should have some knowledge of coding and be sure everything works correctly in your installation.

In a custom plugin I added:

require_once('classes/TLPBPStaffExtras.php');

classers/TLPBPStaffExtras.php:

<?php
if (class_exists('BookingPress_Core')) {

  class TLPBPStaffExtras Extends BookingPress_Core {

    var $bookingpress_appointment_booking_id;
    var $bookingpress_booking_id;
    var $bookingpress_staffmember_id;
    var $bookingpress_rating_active_color;
    var $bookingpress_rating_disable_color;

    function __construct() {
      global $bookingpress_pro_version, $wpdb;

      add_filter('bookingpress_frontend_apointment_form_add_dynamic_data', array($this, 'tlp_staff_data'), 15);
      add_filter('bookingpress_front_staffmember_list_extra_detail', array($this, 'tlp_staff_extras'));
    }

    function tlp_staff_data($bookingpress_front_vue_data_fields) {
      global $wpdb, $BookingPress;
      $staff_notes = $wpdb->get_results($wpdb->prepare("select bookingpress_staffmember_id as id, bookingpress_staffmembermeta_value as note from wp_bookingpress_staffmembers_meta where bookingpress_staffmembermeta_key = '%s';", 'staffmember_note'));

      $bookingpress_front_vue_data_fields['staff_notes'] = [];

      foreach ($staff_notes as $result) {
        $bookingpress_front_vue_data_fields['staff_notes'][$result->id] = stripslashes_deep($result->note);
      }

      return $bookingpress_front_vue_data_fields;
    }

    function tlp_staff_extras() {
      global $BookingPress;

      ?>{{ staff_notes[staffmember_details.bookingpress_staffmember_id] }}<?php

    }
  }

}

global $tlp_bp_staff_extras;
$tlp_bp_staff_extras = new TLPBPStaffExtras();

0    4 weeks ago    Reply

Comment must be at least 20 characters.
Cancel

We love to listen to our customers.

One vote
Categories
🎉 Feature