At the resource level you can configure fixed duration or fixed time slots.
But calculation of the duration basing on selected price options and fields is not supported.
First, the client selects the start and end time.
And only then can choose price options and fill in additional fields.
However, you can add a check for the selected duration.
And if the client chooses the wrong combination of duration, price options or fields, he will see an error on the widget.
To do this, create hints in the resource. Set them to type - Error.
And in the constraints specify the duration limits and price options at which the error will be displayed.
The configuration will look like this:
Try to book a different duration for different services: