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?
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].
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.