Skip Navigation

[Resolved] City does not appear in custom search post relationship filters

This thread is resolved. Here is a description of the problem and solution.

Problem: I have a custom search View with post relationship filters for City and State, but some Cities never appear in the filters.

Solution: Be sure to provide default options for all search filters like number of bedrooms and number of bathrooms, otherwise, Cities without matching Properties will never appear in the filter options.

This support ticket is created 3 years, 11 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 - -
13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 - -

Supporter timezone: America/New_York (GMT-04:00)

Author
Posts
#1953927

I tried to configure a search by STATE and CITY following the tutorials for my real estate agency.
In the page 'find my property', the search by STATE and CITY doesn't work for my new properties adds with the CRED form.

The properties have a STATE and a CITY assigned. This information appears on the properties page and in the view.
The relationships are PROPERTIES > CITIES > STATES.

I've been trying many things for several days but I can't find the solution.

Link to a page where the issue can be seen: hidden link
> As you can see the STATES/CITY is show in the view (blue background) but doesn't filter the search

#1954199

Hello, I'll be glad to take a closer look if you provide login credentials in the private fields here. When I filter by state (Arizona) and city (Tucson), the results seem to be filtered as expected. Which state and city would you like for me to test?

#1954323

Hi, unfortunately I did not receive login credentials with your latest reply. Can you try to submit those again?

#1954379
Screen Shot 2021-02-17 at 10.36.13 AM.png

Okay the problem was there was no "default" option for the number of bedrooms or number of bathrooms search filters. When no default option is provided, the default value is "1", but none of the properties in Lyon have 1 bedroom and 1 bathroom, so those properties were not included in the results, and the city Lyon would never appear in the filters. I have added a default option "Please select" to the bedroom and bathroom filters, and now I believe the search is working as expected for city LYON and state AUVERGNE RHONE ALPES. Please verify and let me know if the problem is not resolved. You can edit each search filter and change the default text as desired.

#1954393

My issue is resolved now.
Thank you for being so responsive and finding the solution so quickly!