Help needed Wix Bookings

Hi there, could anyone help me with the following issue with Wix bookings:

We want to use Wix bookings for a wellness company that offers floating on salt water. They have two individual floating cabins (for 1 person) which can be booked seperately or at the same time (for duo floats).

We need to be sure that the hours/ time slots will be blocked correctly in the booking system. So if someone books a single float for floating cabin 1, this one should be blocked but floating cabin 2 should be still available. This seems to work. BUT, here is the tricky stuff. If someone books a duo float (so two people at the same time, using floating cabin 1 and 2 at the same time (in the backend I added a staff member 3 that represents floating cabin 1+2). We need to be sure that both cabins are blocked also for bookers who want to book a single float, so 1 cabin later on (in that same time slot).

I tried to solve this with adding staff members. Instead of staff member 1, 2 etc. I named it floating cabin 1, floating cabin 2 and floating cabin 1 + 2 (so 3 staff members) with the same time slots availability. But if someone books a duo float and therefor floating cabin 1+2 is selected, I still see that the time slot for the separate cabins are still open (for single floats). We want that to be blocked once a duo float is booked before. Can someone help me with this, or solve this with code? If so, please contact me asap. Thank you.

Hi @lidia ,

You case is interesting and very common.
For this scenario to work, I’d do the following:

  1. Create a service for a “single cabin” with 2 staff members, i.e: Staff member cabin1 and staff member cabin2, the names are up to you of course.
  2. Create a service for “Both cabins” with same staff members.
    When someone books “single cabin”, execute the getServiceAvailability() API.
    You will get slots for both staff members, display the times when any staff member is available and book one of the slots.
    When someone books “Both cabins”, execute the getServiceAvailability() API.
    You will get slots for both staff members, display the times when both staff members are available and book both slots in that time.

Could you please tell me how I execute the getServiceAvailability() API maybe you could help me with that, since I don’t do code? Please contact me/send me your email. Thank you.

lidia
54m
That’s amazing!! Will try this for sure. Good thinking! Even Wix support couldn’t come up with this answer. Does it work for sure? Have to dive into it again.

Hi @lidia , yes, it works for sure.
Please start with Introduction - Velo API Reference - Wix.com.
You can also refer to the example:

let serviceId = // get service ID

let today = new Date();
let startRange = new Date();
let endRange = new Date();
startRange.setDate(today.getDate() + 7);  // one week from now
endRange.setDate(today.getDate() + 14);   // two weeks from now

let options = {
  startDateTime: startRange,
  endDateTime: endRange
};

return wixBookings.getServiceAvailability(serviceId, options)
  .then( (availability) => {
    let slots = availability.slots;
    let firstSlot = slots[0];
    return availability.slots
  } );

You need to run this method of every cabin service and then build a histogram of slots and get those which have the same time available for both services.

Jacob thank you so much for thinking with me. Is it possible that we get in contact by mail/phone so I can hire your for this job (or anyone who does coding, since I am not skilled to do this)? My mail address: lidia@houseofcommunications.nl

Thank you so much for your help!