function rooms_booking_manager_quantity_change_callback in Rooms - Drupal Booking for Hotels, B&Bs and Vacation Rentals 7
AJAX callback on booking search results page when quantity change.
3 string references to 'rooms_booking_manager_quantity_change_callback'
- book_unit_form_builder in modules/
rooms_booking_manager/ rooms_booking_manager.module - The form builder builds the form (where visible is simply the purchase button) for individual bookable units.
- _rooms_booking_manager_handle_per_person_pricing in modules/
rooms_booking_manager/ rooms_booking_manager.units_per_type_form.inc - Handles display for per person pricing.
- _rooms_booking_manager_load_price_info in modules/
rooms_booking_manager/ rooms_booking_manager.units_per_type_form.inc - Loads the price information for a given unit type/price level combination.
File
- modules/
rooms_booking_manager/ rooms_booking_manager.module, line 1858 - Rooms Booking Manager brings together all the pieces required to find a room and book it - including the DrupalCommerce integration
Code
function rooms_booking_manager_quantity_change_callback(&$form, $form_state) {
list($type, $price) = preg_split('/[\\[(.)\\]]/', $form_state['triggering_element']['#name']);
// Show availability of individual units.
if ($price == '') {
return $form['new_price'];
}
else {
return $form[$type][$price]['fieldset'];
}
}