Hi! I try hide the widget for select "rooms" In the "Availability Search" block, Is possible this?

CommentFileSizeAuthor
#6 hide_number_of_rooms.zip1.38 KBManuel P.V.
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

scalas89’s picture

Hi @Manuel P.V. - you're referring to the "Select Type"?

Manuel P.V.’s picture

No, I refer to the widget where is selected the number of "rooms" for "search availability".

Arrival Date - Departure Date - Rooms - Adults - Children - Unit Type - Search fo Availability.

scalas89’s picture

I think you can use the hook_form_FORM_ID_alter() and hide the element.

/**
 * Implements hook_form_FORM_ID_alter().
 *
 * FORM_ID = rooms_booking_availability_search_form_builder
 * Hide units select form from the availability search.
 */
function your_module_form_rooms_booking_availability_search_form_builder_alter(&$form, &$form_state, $form_id) {
   $form['conditions']['rooms']['#type'] = 'hidden';
}

This should hide the element

Manuel P.V.’s picture

Excuse me. I understand that this code:

function
your_module_form_rooms_booking_availability_search_form_builder_alter(&$form, &$form_state, $form_id) {
$form['conditions']['rooms']['#type'] = 'hidden';
}

I have to introduce it literaly it in the "rooms_booking_manager.module" file. (...) Before the line "rooms_booking_availability_search_form_builder"? in the line 781 of the file.

And open and close the php isn't necessary.
This part of the line "your_module_form_(...)" confuses me.

Is it right?

scalas89’s picture

No - If you have a custom module you can use the code of my comment (#3) replacing "your_module" with your custom module name.
Feel free to send me a pv fon any help :)

Regards

Manuel P.V.’s picture

FileSize
1.38 KB

Ok @scalas89 Thank you very much! Work Perfectly :) I didn't know how to create a custom module, and I was researching ... it's curious that the hooks. Learning...

This is the hide_number_of_rooms micro-module (add-on) jajaj attached in.zip file! Thank you man.

ronald_istos’s picture

Status: Active » Closed (fixed)
WtheM’s picture

Category: Support request » Feature request

I think it shall be avaliable in rooms configuration.