Hello,
We have cabins that accommodate from 2 to 10 persons, so I wonder if the search widget can be configured to look out for up to 10 occupants?

Or what can I (no coder) possibly do?

Warm regards from sunny México!
: )
Pepe

Comments

larowlan’s picture

Category: support » feature
Issue tags: +Release blocker

Hi Pepe
Unfortunately as it stands the only solution is via a custom module.
You can create a new module and add something like so (untested)

/**
 * Implements hook_form_FORM_ID_alter
 */
function MYMODULE_form_hotel_booking_search_form_alter(&$form, $form_state) {
    $form['search']['adults']['#options'] = drupal_map_assoc(range(0,10));
}

Happy to take a patch that adds this as a config option.
LR

PepeMty’s picture

Thank you, Lee!
I'll give it a try next Friday 'cause I don't have any spare time these two days ; )

Besides, I see you marked this issue as a release blocker. I feel kind of honored just to think this might get into uc_hotel core : )

Best regards!
: )
Pepe

PepeMty’s picture

Lee et al,
Sorry to bother you again, but after using the module builder to make the module, and installing it, I received this error message:

Parse error: syntax error, unexpected T_LNUMBER, expecting T_STRING in /home/myserver/mysite.com/sites/all/modules/10ocupantes/10ocupantes.module on line 12

Here is my module code:

<?php
// $Id$

/**
 * @file
 * TODO: Enter file description here.
 */

/**
 * Implementation of hook_form_FORM_ID_alter().
 */
function 10ocupantes_form_FORM_ID_alter(&$form, &$form_state) {
    $form['search']['adults']['#options'] = drupal_map_assoc(range(0,10));
}

I know it's different from what you suggested, but I used that one too and also have an error message, so I used what the builder module gave me plus $form['search']['adults']['#options'] = drupal_map_assoc(range(0,10));

Any suggestions?
Best regards!
: )
Pepe

larowlan’s picture

Hi Pepe
Function names (and hence module names) can't start with a number.
LR

larowlan’s picture

Also you need to change the FORM_ID in the function name to hotel_booking_search_form

PepeMty’s picture

Lee,
Both posts 4 + 5 did the trick!
I thank you again : )

Warmest regards from way too sunny (and hot) México!
: )
Pepe