Crocoblock / suggestions

The suggestions for CrocoBlock project
194 stars 78 forks source link

[JetAppointment] Services with different durations and Providers with different days of the week #4624

Open WebTechPT opened 2 years ago

WebTechPT commented 2 years ago

I have 2 Services: Service A: 30 minutes duration Service B: 60 minutes duration

I have 2 people on the team: Person A: Works Monday, Wednesday and Friday Person B: Works Tuesday and Thursday

When I set "Custom Schedule" on Team Person, it forces me to set "Duration" and ignore Service Duration...

Loverko008 commented 2 years ago

I have the same problem. I can't remove the time slot for Teams /Providers/. I was looking for it in the code but I can't find it.

Loverko008 commented 2 years ago

I wrote in support and this is the answer.

Thank you to contact our support team and sorry for the delay.

The hierarchy of the appointment scheduling is built in that way:

  1. Provider schedule is the main schedule
  2. Service schedule
  3. Dashboard schedule. ​ Sorry, but there is no opportunity to delete the element that you marked on the screenshot because it breaks the work logic of the JetAppointment plugin. Hope it is clear😉
Loverko008 commented 2 years ago

added a snippet to ignore: duration, buffer time before, buffer time after, locked time before parameters

`add_filter( 'jet-apb/calendar/custom-schedule', '__modify_appointment_data', 0, 5 );

function __modify_appointment_data ( $value, $meta_key, $default_value, $provider, $service ) { if ( $provider && 'buffer_before'===$meta_key || 'buffer_after'===$meta_key || 'locked_time'===$meta_key || 'default_slot'===$meta_key ){ $calendar = \JET_APB\Plugin::instance()->calendar; if ( 'recursive' !== $default_value && $calendar->get_schedule_settings( $provider, $service, null, 'use_custom_schedule' ) ) { $value = $calendar->get_schedule_settings( null, $service, 'recursive', $meta_key ); } } return $value; }`

Panark commented 2 years ago

YES! That's exactly what i am facing with a project! I want to have working hours taken from the Employees BUT duration to be always from the service. I thing there is a necessity to detach the duration from the working hours because they are 2 different things and be able to choose where to use working hours and duration (from Employee or from Service).

By the way, the code snippet from Loverko008 worked like a charm and did exactly this