When submitting a list we get the error “Purchase Slot Duration” field is required

Hi there team HP.

We’ve enabled Time Slots as we need the days available for the listings. However we want to unset all the other attributes that comes with the Time Slots function.

We’ve compiled this code from modifying snippets:
unset( $form[‘fields’][‘booking_window’] );
//unset( $form[‘fields’][‘booking_min_time’] );
//unset( $form[‘fields’][‘booking_max_time’] );
unset( $form[‘fields’][‘booking_min_quantity’] );
unset( $form[‘fields’][‘booking_max_quantity’] );
unset( $form[‘fields’][‘booking_slot_duration’] );
unset( $form[‘fields’][‘booking_slot_interval’] );
unset( $form[‘fields’][‘booking_moderated’]);
unset( $form[‘fields’][‘booking_min_length’] );
unset( $form[‘fields’][‘booking_max_length’] );

But when submitting a list we get the error “Purchase Slot Duration” field is required.

Is it possible to use only the Days Available in some way?

Hi,

Unfortunately, it won’t work this way, because in order for time slots to work, you need to fill in three fields:

  • Booking Available From
  • Booking Available To
  • Booking Slot Duration

I hope this is helpful to you.

Hi there team HP
Could we somehow pass a default value and hide the Booking Slot Duration?

Yes, if the service duration is the same for all listings this may be possible with a custom code snippet.

Which code snippet can we use to do this?

You can try using the snippet suggested in this topic Set a default value for a Booking Slot Duration setting and hide it from listing creation - #3 by SamMSFT

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.