Closed (fixed)
Project:
Hotel Booking System for Ubercart
Version:
6.x-2.0-beta4
Component:
Code
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
24 Feb 2011 at 15:45 UTC
Updated:
30 Mar 2011 at 01:05 UTC
Hello,
I want to add some more fields like
1: Type of accommodation
2: Country
3: Destination
in Room search form block of uc_hotel module
How i can add the fields in search form .
Any body can help me. I really need this to complete my website
Thanks
Comments
Comment #1
larowlanHi
The module's forms are built using the Drupal form api.
You can use hook_form_alter to add your fields and manipulate the search results.
See api.drupal.org for more information on hook_form_alter.
Lee
Comment #2
larowlanComment #3
cis.drupal commentedThanks for you help.
Ok i can add the other fields from form alter then how my new fields would involve in search.
Comment #4
larowlanThere's a drupal_alter('hotel_booking_available_rooms') in the module but the search results are also a form.
If you analyse the form you'll see there's $form['results'] for the results - these are keyed by node and you can access your fields from form_state['values']. You can unset the invalid ones.
Comment #5
cis.drupal commentedThank you for your kind help.
But i alter form hook form alter - hotel_booking_search_form
From my custom module but i did not get any way to involve my search filter in its search.
i try to alter hotel_booking_search_results but not found any form.
I struck over here for the right way.
Thanks
Comment #6
larowlanHi
It's the same form (hotel_booking_search_form), but the results are appended, something like this will get you started (you need the devel module installed):
Obviously change MYMODULE to your module's name
Comment #7
cis.drupal commentedThanks for your kind help.
It works now for me.:)
Comment #9
larowlan