How to enable search by guests

I created a “Guests” attribute for my listings, where users can specify the maximum number of guests that a property can accommodate. I also made this attribute searchable, so it appears in the search bar.

However, I’ve noticed a problem:
when I search for properties for 2 guests, the results only show listings that can accommodate exactly 2 guests.

The expected behavior should be different — if someone searches for a property for 2 guests, they should also see listings that can accommodate at least 2 people, such as 3, 4, 5, or 10 guests.

How can I change the search logic for this attribute so that the results include all properties where the maximum number of guests is greater than or equal to the number entered in the search?

Thanks

Hi,

Attributes of this type work by searching for an exact match. If you want to add a Guests option to the search filter, please use the built-in Bookings feature. To do this, go to WP > HivePress > Settings > Bookings and enable the “Allow multiple places per booking” option. Then, navigate to WP > HivePress > Settings > Listings > Search and select Places to display this option on the search form. This will allow users to search listings by the number of guests, and you’ll also be able to manage the property capacity within each listing [please see the example].

You can also change the label from “Places” to “Guests” using Loco Translate: How to translate a theme - HivePress Help Center

Hope I helped with your request

1 Like

Hi, thanks for your help. How can add the max places for the listing in the block (secondary) and in the page(ternary) ?

Please try the solution from this topic. Another workaround is to reuse the display format of another required attribute, which can be related to this value, and add booking_max_quantity. Please see the example: attribute settings and how it is displayed.

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.