As per the functionality of our Booking & Appointment for WooCommerce plugin, one resource can provide different services but not at the same time. In this case, one needs to learn how validations are applied to the resources.
Let’s understand the applicability of validations to resources.
You have added the Resource – Kinjal to all 3 examples of different booking types explained in this documentation. ADD LINK
Let’s see how the availability of this resource appears in the booking calendar for the customers to select and how they are restricted to different services for the same day.
There are 2 types of validations:
1. Availability message validation
2. Cart Page validation
1. Availability message validation
The Availability message gives information about the availability of the product for selected booking details and is displayed above the booking field.
INSTANCE 1
Let’s say that a customer has already added the bookable product to the cart and then revisits the product page. They select the same resource and booking details.
The availability notification message will show ‘The booking is already added to the cart.’
Adding the same date and resource again
INSTANCE 2
Let’s say a customer books the resource Kinjal for 20th March 2018 for the One Day Bridal Package product.
After this, they go back to the product page and select the same product with the same date and resource. However, here, the resource has reached its maximum availability.
In such an instance, a message saying ‘You have all available spaces for this date in the cart. Please visit the cart to place the order’ will be displayed.
It would mean that the customer has added all the available booking slots for this resource in the cart. That’s why it is recommended that they to go their cart to place the order.
Resource selected for One Day Bridal Package product
INSTANCE 3
Let’s say an Order has been placed for 20th March 2018 for Kinjal:
Order details for the booking
The Availability Quantity for this resource – Kinjal is set to 1 for each day as shown below:
Maximum bookings to be taken for each day is 1
If some other customer comes to book the same product for Kinjal for the same date 20th March 2018, then the booking calendar will show this date disabled as the availability for Kinjal for the given date is set to 1.
Resource booked for 20th March, 2018
20th March 2018 will show a ‘Booked’ message in the booking calendar when a customer hovers on that date. That’s because Kinjal is booked for the One Day Bridal Package for the same date already.
2. Cart Page validation
Let’s say that a customer adds a particular resource and booking details for service in the cart. If the same resource with a different service is already present in the cart with the maximum available quantity for the selected dates, then such an action should be validated.
For Example – A customer has booked Kinjal for Outdoor Wedding Bookings from 1st February 2018 to 19th February 2018.
Cart shows resource Kinjal
Now if you try to add One Day Bridal Package for 9th February 2018 for the same Resource Kinjal, then it will show ‘You have all available spaces for Kinjal on date 02/09/18 in your cart. Please visit the cart to place the order’ error message.
It would mean that all the availability slots for the Resource Kinjal on the date 02/09/18 have already been added to the customer’s cart. The customer simply needs to move to the cart page now to place the order.
Cart showing an error message
On the Cart page, when a customer tries to increase the quantity of the product for more than the resource’s availability, then a notification message will appear. It will say ‘Kinjal can provide only 1 service for the date 02/09/18.’
A notification message appears when the quantity exceeds
Kinjal is available for only 1 quantity and if the customer tries to increase the quantity more than that, then the notification message shown above will be displayed.
The validations will thus be applied in this manner to all of your resources based on the conditions applied.