uHotel always has to search in a property type

Discuss everything related to PHP Hotel Site. All versions. Any questions related to the PHP Hotel Site developing or using should be posted to this forum.

Moderators: ne_moj, zewa, vadimako, ne_moj, zewa, vadimako

PrinceOfAbyss
Junior
Junior
Posts: 13
Joined: Apr 1st, '18, 23:17

uHotel always has to search in a property type

Postby PrinceOfAbyss » Apr 1st, '18, 23:28

Hi.

I have a huge problem making uHotel Booking search in every property type.

I have many property types, like Villas, Cottages, Exclusive Villas, etc etc... So I was struggling to figure out why it only returns specific accommodation places every times, while it never returned other ones, although I had bouble and triple checked that their availability tables were set fine.

I just realized that it has to always search in a specific property type, and even when one is not set through the hidden field <input name="property_type_id" value="" id="property_type_id" type="hidden"> of the search form, it returns only the places of the first property type's category.

Is there a way to make it search in ALL property types when none is set?

PrinceOfAbyss
Junior
Junior
Posts: 13
Joined: Apr 1st, '18, 23:17

Re: uHotel always has to search in a property type

Postby PrinceOfAbyss » Apr 2nd, '18, 00:10

Problem is line 1757 in Rooms.class.php

Code: Select all

$hotel_where_clause .= (!empty($property_type_id)) ? 'h.property_type_id = '.(int)$property_type_id.' AND ' : '';


I suspect there is a bug somewhere around there, as if you

Code: Select all

echo $property_type_id
at that place, it will never be empty, because there is other code setting it forcefully to the property type of the first (or the default) property in hotels.

administrator
Site Admin
Site Admin
Posts: 5981
Joined: Jan 7th, '09, 23:18
Contact:

Re: uHotel always has to search in a property type

Postby administrator » Apr 2nd, '18, 14:38

So what the problem? If it's empty, it doesn't generate error.

PrinceOfAbyss
Junior
Junior
Posts: 13
Joined: Apr 1st, '18, 23:17

Re: uHotel always has to search in a property type

Postby PrinceOfAbyss » Apr 2nd, '18, 15:13

Would you like me to PM you with info on my site to see the problem in action?

Like I said, the script always returns houses from one property type... I know it's like that by design, as a tab is chosen at any time. But there might be a case where one might need to search among ALL property types...

IMHO for the next update you should implement the first tab of the search box to be the All, and then it should generate the rest tabs by going through the relevant table...

administrator
Site Admin
Site Admin
Posts: 5981
Joined: Jan 7th, '09, 23:18
Contact:

Re: uHotel always has to search in a property type

Postby administrator » Apr 5th, '18, 12:42

Thanks, we'll check the possibility to add "All" tab.


Return to “ApPHP HotelSite / uHotelBooking Talk {developers/users}”