title: how to override existing wordpress Bookly plugin file
body: <p>I want to some changes in existing bookly plugin file but no effected to original one but when i have try to override plugin template and put into the wordpress theme directory but its not work.</p>
  
  <p>This is my plugin file which I have made some changes but I dont know how to override in my theme directory.</p>
  
  <p>plugins/bookly-responsive-appointment-booking-tool/backend/components/dialogs/appointment/edit/Ajax.php</p>
  
  <p>And i have put this directory like this </p>
  
  <p>wp-content/themes/themify-ultra-child/bookly-responsive-appointment-booking-tool/backend/components/dialogs/appointment/edit/Ajax.php </p>
  
  <pre><code>public static function getDataForAppointmentForm()
      {
          $type = self::parameter( 'type', false ) == 'package'
              ? Lib\Entities\Service::TYPE_PACKAGE
              : Lib\Entities\Service::TYPE_SIMPLE;
  
          $statuses = Lib\Proxy\CustomStatuses::prepareAllStatuses( array(
              Lib\Entities\CustomerAppointment::STATUS_PENDING,
              Lib\Entities\CustomerAppointment::STATUS_APPROVED,
              Lib\Entities\CustomerAppointment::STATUS_CANCELLED,
              Lib\Entities\CustomerAppointment::STATUS_REJECTED,
              Lib\Entities\CustomerAppointment::STATUS_WAITLISTED,
              Lib\Entities\CustomerAppointment::STATUS_DONE,
          ) );
          $status_items = array();
          foreach ( $statuses as $status ) {
              $status_items[ $status ] = Lib\Entities\CustomerAppointment::statusToString( $status );
          }
  
          $result = array(
              'staff'                    =&gt; array(),
              'customers'                =&gt; array(),
              'start_time'               =&gt; array(),
              'end_time'                 =&gt; array(),
              'app_start_time'           =&gt; null,  // Appointment start time which may not be in the list of start times.
              'app_end_time'             =&gt; null,  // Appointment end time which may not be in the list of end times.
              'week_days'                =&gt; array(),
              'time_interval'            =&gt; Lib\Config::getTimeSlotLength(),
              'status'                   =&gt; array(
                  'items' =&gt; $status_items,
              ),
              'extras_consider_duration' =&gt; (int) Lib\Proxy\ServiceExtras::considerDuration( true ),
              'extras_multiply_nop'      =&gt; (int) get_option( 'bookly_service_extras_multiply_nop', 1 ),
          );
  
          // Staff list.
          $staff         = Lib\Entities\Staff::query()-&gt;findOne();
          $staff_members = $staff ? Lib\Config::proActive() ? Lib\Utils\Common::isCurrentUserSupervisor() ? Lib\Entities\Staff::query()-&gt;sortBy( 'position' )-&gt;find() : Lib\Entities\Staff::query()-&gt;where( 'wp_user_id', get_current_user_id() )-&gt;find() : array( $staff ) : array();
          $postfix_archived = sprintf( ' (%s)', __( 'Archived', 'bookly' ) );
  
          $max_duration  = 0;
          $has_categories = (bool) Lib\Entities\Category::query()-&gt;findOne();
  
          foreach ( $staff_members as $staff_member ) {
              $services = array();
              if ( $type == Lib\Entities\Service::TYPE_SIMPLE ) {
                  $services = Proxy\Pro::addCustomService( $services );
              }
              foreach ( $staff_member-&gt;getStaffServices( $type ) as $staff_service ) {
                  $sub_services = $staff_service-&gt;service-&gt;getSubServices();
                  if ( $type == Lib\Entities\Service::TYPE_SIMPLE || ! empty( $sub_services ) ) {
                      if ( $staff_service-&gt;getLocationId() === null || Lib\Proxy\Locations::prepareStaffLocationId( $staff_service-&gt;getLocationId(), $staff_service-&gt;getStaffId() ) == $staff_service-&gt;getLocationId() ) {
                          if ( ! in_array( $staff_service-&gt;service-&gt;getId(), array_map( function ( $service ) { return $service['id']; }, $services ) ) ) {
                              $category = Lib\Entities\Category::find( Lib\Entities\Service::find( $staff_service-&gt;getServiceId() )-&gt;getCategoryId() );
                              $services[] = array(
                                  'id'              =&gt; $staff_service-&gt;service-&gt;getId(),
                                  'title'           =&gt; sprintf(
                                      '%s (%s)',
                                      $staff_service-&gt;service-&gt;getTitle(),
                                      Lib\Utils\DateTime::secondsToInterval( $staff_service-&gt;service-&gt;getDuration() )
                                  ),
                                  'category'        =&gt; $category ? $category-&gt;getName() : ( $has_categories ? __( 'Uncategorized', 'bookly' ) : ''),
                                  'duration'        =&gt; $staff_service-&gt;service-&gt;getDuration(),
                                  'units_min'       =&gt; $staff_service-&gt;service-&gt;getUnitsMin(),
                                  'units_max'       =&gt; $staff_service-&gt;service-&gt;getUnitsMax(),
                                  'locations'       =&gt; array(
                                      ( $staff_service-&gt;getLocationId() ?: 0 ) =&gt; array(
                                          'capacity_min' =&gt; Lib\Config::groupBookingActive() ? $staff_service-&gt;getCapacityMin() : 1,
                                          'capacity_max' =&gt; Lib\Config::groupBookingActive() ? $staff_service-&gt;getCapacityMax() : 1,
                                      ),
                                  ),
                              );
                              $max_duration = max( $max_duration, $staff_service-&gt;service-&gt;getUnitsMax() * $staff_service-&gt;service-&gt;getDuration() );
                          } else {
                              array_walk( $services, function ( &amp;$item ) use ( $staff_service ) {
                                  if ( $item['id'] == $staff_service-&gt;service-&gt;getId() ) {
                                      $item['locations'][ $staff_service-&gt;getLocationId() ?: 0 ] = array(
                                          'capacity_min' =&gt; Lib\Config::groupBookingActive() ? $staff_service-&gt;getCapacityMin() : 1,
                                          'capacity_max' =&gt; Lib\Config::groupBookingActive() ? $staff_service-&gt;getCapacityMax() : 1,
                                      );
                                  }
                              } );
                          }
                      }
                  }
              }
              $locations = array();
              foreach ( (array) Lib\Proxy\Locations::findByStaffId( $staff_member-&gt;getId() ) as $location ) {
                  $locations[] = array(
                      'id'   =&gt; $location-&gt;getId(),
                      'name' =&gt; $location-&gt;getName(),
                  );
              }
              $result['staff'][] = array(
                  'id'        =&gt; $staff_member-&gt;getId(),
                  'full_name' =&gt; $staff_member-&gt;getFullName() . ( $staff_member-&gt;getVisibility() == 'archive' ? $postfix_archived : '' ),
                  'archived'  =&gt; $staff_member-&gt;getVisibility() == 'archive',
                  'services'  =&gt; $services,
                  'locations' =&gt; $locations,
                  'category'  =&gt; Lib\Proxy\Pro::getStaffCategoryName( $staff_member-&gt;getCategoryId() ),
              );
          }
  
          /** @var Lib\Entities\Customer $customer */
          // Customers list.
          foreach ( Lib\Entities\Customer::query()-&gt;sortBy( 'full_name' )-&gt;find() as $customer ) {
              $name = $customer-&gt;getFullName();
              if ( $customer-&gt;getEmail() != '' || $customer-&gt;getPhone() != '' ) {
                  // $name .= ' (' . trim( $customer-&gt;getEmail() . ', ' . $customer-&gt;getPhone(), ', ' ) . ')';
                       // $name .= ' (sdsfd)';
  
                       // echo '&lt;pre&gt;',print_r($customer-&gt;getCity()),'&lt;/pre&gt;';
                  $name .= ' ('.trim($customer-&gt;getStreet().', ' .$customer-&gt;getPostcode()).')';
              }
  
              $result['customers'][] = array(
                  'id'                 =&gt; $customer-&gt;getId(),
                  'name'               =&gt; $name,
                  'status'             =&gt; Lib\Proxy\CustomerGroups::prepareDefaultAppointmentStatus( get_option( 'bookly_gen_default_appointment_status' ), $customer-&gt;getGroupId() ),
                  'custom_fields'      =&gt; array(),
                  'timezone'           =&gt; Lib\Proxy\Pro::getLastCustomerTimezone( $customer-&gt;getId() ),
                  'number_of_persons'  =&gt; 1,
              );
          }
  
          // Time list.
          $ts_length  = Lib\Config::getTimeSlotLength();
          $time_start = 0;
          $time_end   = max( $max_duration + DAY_IN_SECONDS, DAY_IN_SECONDS * 2 );
  
          // Run the loop.
          while ( $time_start &lt;= $time_end ) {
              $slot = array(
                  'value' =&gt; Lib\Utils\DateTime::buildTimeString( $time_start, false ),
                  'title' =&gt; Lib\Utils\DateTime::formatTime( $time_start ),
              );
              if ( $time_start &lt; DAY_IN_SECONDS ) {
                  $result['start_time'][] = $slot;
              }
              $result['end_time'][] = $slot;
              $time_start += $ts_length;
          }
  
          $days_times = Lib\Config::getDaysAndTimes();
          $weekdays  = array( 1 =&gt; 'sun', 'mon', 'tue', 'wed', 'thu', 'fri', 'sat', );
          foreach ( $days_times['days'] as $index =&gt; $abbrev ) {
              $result['week_days'][] = $weekdays[ $index ];
          }
  
          if ( $type == Lib\Entities\Service::TYPE_PACKAGE ) {
              $result = Proxy\Shared::prepareDataForPackage( $result );
          }
  
          wp_send_json( $result );
      }
  </code></pre>
  
  <p>Does not override the plugin in theme folder.</p>