Skip Navigation

[Resolved] Search setting

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

Problem:
The user was having an erroneous view, no results were returned as soon as we choose another search filter than the category.

Solution:
The view was having too much control filters with no query filters associated.
We fixed the issue by removing all the control filters and recreating them again, which creates the underlying query filters.

This support ticket is created 3 years, 10 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
9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 - - 9:00 – 13:00
14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 - - 14:00 – 18:00

Supporter timezone: Africa/Casablanca (GMT+01:00)

This topic contains 5 replies, has 2 voices.

Last updated by yosukeS 3 years, 9 months ago.

Assisted by: Jamal.

Author
Posts
#1671697

Tell us what you are trying to do?

my top page search has a lot of filters. I would like to show the results based on partial select. For example, a visitor can only choose a category but the rest of the filter leave blank so the search ignores all other filters except a category selection and shows the result.
How can I do that?

Right now, when the page is loaded for the first time, it shows all times(view filter "visible" custom field filter applied as a default display search, however as soon as I choose a option from the form filter and hit search, all result will be gone. It does not display even i set exact parameter which meets to a specific post. The results still shows none. What am I doing wrong?

Is there any documentation that you are following?

Is there a similar example that we can see?

What is the link to your site?

#1672305

Jamal
Supporter

Languages: English (English ) French (Français )

Timezone: Africa/Casablanca (GMT+01:00)

Hello and thank you for contacting the Toolset support.

To better assist you with this issue, I'll need to take a closer look at your view. Please allow me temporary access to your admin area and specify which view/page we can see the issue. It would be also helpful if you provide an example of test code(choose ... and ..., we should expect "xxx", instead we get "yyy")
Your next reply will be private to let you share credentials safely. ** Make a database backup before sharing credentials. **

#1677753

Jamal
Supporter

Languages: English (English ) French (Français )

Timezone: Africa/Casablanca (GMT+01:00)

Thank you for the access credentials. I think that the issue with the view is the difference between control filters and query filters. Not all the control filters have a query filter for it:
- The relationship control filter does not have a query filter on the appropriate relationship.
- There is no filter on the price of the listing.
- There is no filter on the broker custom field.

To investigate this a bit, I created a private page "Toolset Support" and duplicated the view to "Toolset support - Toppage - Search filter and Result in grid (June2020)". hidden link

First, I disabled all the control filters except the category and the type custom field. The view worked without issues. Sorting worked also.
Then, I enabled price filters and created a query filter on the price custom field, as a number, between the minimum and the maximum prices. It worked.
Then, I enabled the broker checkbox and added a query filter on the custom field (agent-co-broker). It worked.
Then, I added the relationship filter on counties, which created the query filter around it. It worked.

Please note, that the maximum price is set by default to 50000$ which is lower than the available listing, so it will always return no results until you choose a higher maximum price. Or you may set the default maximum price to the highest value.

I did not update the "Toppage - Search filter and Result in grid (June2020)" view. You can just remove the control filters that do not have a query filter and add them again, which will create the query filter for you. Or you can add the query filters manually. Check my duplicate view to spot the differences.

I hope this helps. Let me know if you still need assistance with your view.

#1679273

Thank you so much for taking a look at my site and identify the problem!
I really appreciate it!

The demo page your created works well and I compared mine and yours to see how I set things wrong.

As you suggested I would like to set default max price as "more than 400,000" But I don't know how. I quickly add "more than 400,000" as the first choice but, as you can see, you see the same selection twice.. because I want to keep drop down menu price increase as the list goes down(looks natural that way). So my question is, can I set a value in the list as a default? Or that way I set is only way to set a default?

I have another question. It might now fit in here but I write here because it's related to the search.
I have a public business list and a restricted business list. They are in relationships. Some of the search criteria is coming from custom fields on the public list, others are coming from ones on the restricted list(parent). Is there any way to pass a certain value from a restricted list to a public list and save?

The whole purpose of making 2 lists is hiding certain information from the general public. For example, now we have 2 prices (one on a restricted list and another one on a public list). I set this way because certain users want to keep their pricing different or unclear for the public. However for restricted list, they have to enter correct price to provide accurate information for certain viewers.

Ideally, If the author of a restricted list, saved a price, the price also applied to the public one, so he needs only enter once. If he wants to write his own price for public only, he can click a override box and set a new price for public list independently. ( I would like to apply the same setting to other fields as well such as rent and etc.)

As of now the list result shows two prices $0 and other price. I was testing this logic but I was't sure if Types plug in can do this or not.

If there is a mean to do this, could you please provide how to.

Thank you.

New threads created by Jamal and linked to this one are listed below:

https://toolset.com/forums/topic/help-with-custom-post-types-custom-fields-and-views-setup/

#1682451

Jamal
Supporter

Languages: English (English ) French (Français )

Timezone: Africa/Casablanca (GMT+01:00)

There is, currently, no direct way to select a default value. The first value is always the default one. We can use a custom Javascript code to set a default value, or we can modify the maximum price to list values from the highest to the lowest. Check this example:

[wpv-control-postmeta type="select" field="wpcf-business-price" source="custom" class="price-range" url_param="wpv-wpcf-business-price_max" values="100000000,400000,200000,100000,50000" display_values="More than 400%%COMMA%%000,400%%COMMA%%000,200%%COMMA%%000,100%%COMMA%%000,50%%COMMA%%000"]

Instead of:

[wpv-control-postmeta type="select" field="wpcf-business-price" source="custom" class="price-range" url_param="wpv-wpcf-business-price_max" values="50000,100000,200000,400000,100000000" display_values="50%%COMMA%%000,100%%COMMA%%000,200%%COMMA%%000,400%%COMMA%%000,More than 400%%COMMA%%000"]

Regarding your second question, I'd prefer to open another ticket, as I need more information, and also because this view is not configured to display Restricted Listings. For that reason, I created a new ticket for you and I'll be posting my questions there.

If you think that the original issue of this ticket is handled, please mark this ticket as resolved. Otherwise, let me know what is still needed.

#1683119

My issue is resolved now. Thank you!

This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.