Currently when an availability search is performed (in the case of display rooms by type), and a booking for a number of rooms is completed by a user, the actual rooms allocated seem to be more or less random. For my use case, it would be better to have the rooms for a single booking to be in a consecutive block.
Is it possible to sort the initial results of an availability search prior to rooms being assigned to a booking, say by increasing order of unit_id? This would satisfy my use case.
Even better would be to add a field to the bookable_unit (eg booking_priority) and display this field in the unit's edit page [siteurl/admin/rooms/units/unit/1/edit]. That way the site administrator could have some control of the order in which units are booked via the web facing user interface (eg best available, or adjoining rooms), without needing to manually re-assign rooms according to in-house priorities. This would be a more customizable approach that would satisfy more use cases.
| Comment | File | Size | Author |
|---|---|---|---|
| #1 | screenshot_dpm.jpg | 140.22 KB | 1an_m |
| #1 | screenshot_booking_cart.jpg | 46.96 KB | 1an_m |
Comments
Comment #1
1an_m commentedI've made some progress on the simpler version (sort by unit_id). I've figured out where I need to make the change .... but am not sure how to do it!
/modules/rooms_booking_manager/rooms_booking_manager.module
about line 1400
I put a dpm($units_per_type) at this point (see image) and the array $units_per_type consists of
bookable_unit_type
price
unit_id
I have added unit_id to the booking cart view, so it is possible to see that the array of units is added to the line items from the top of the array until the quantity required is satisfied.
I need to find a way to sort the array $units_by_type in ascending order of unit_id prior to allocating the units one by one to the line items, but am not sure how to do it.