Skip Navigation

[Resolved] Split: Search Forms doesn't work as expected

This support ticket is created 6 years 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.

No supporters are available to work today on Toolset forum. Feel free to create tickets and we will handle it as soon as we are online. Thank you for your understanding.

Sun Mon Tue Wed Thu Fri Sat
- 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 -
- 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 -

Supporter timezone: Europe/London (GMT+00:00)

This topic contains 74 replies, has 3 voices.

Last updated by CharlesB2907 6 years ago.

Assisted by: Nigel.

Author
Posts
#1151434

Hi Nigel,

Will the plugins need to remain deactivated over-night?

#1151453

Nigel,

I see the site is active again but a fixed notification bar was not re-activated.

Were any of the installed previously active plugins causing a conflict with the functionality of the Toolset apps?

#1151948

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+00:00)

Hi Chuck

I have been going round in circles with this this morning, including trying and failing to install a copy of your site locally so I could continue testing without disturbing you.

In the end I started to create a new View for testing (called "Toolset", inserted on the page of the same name), which includes just a couple of filters and simply lists the matching posts.

This does work correctly.

Which led me back to the "Single Product List Entry" View which does not.

And the explanation for why the filters are not working turns out to be fairly simple (although accounting for how we ended up in this situation may not be).

When it comes to adding filters to a View it is helpful to think of them in terms of front-end filters and back-end filters.

By back-end filters I mean filters that you add to the Query Filter section of a View, which apply every time the View is loaded, wherever and whenever it is loaded. Such a filter might be a post author filter, for example, where the post author should be the current user, so that whenever someone sees this View on the front end they will only see their own posts.

Front-end filters are the search form filters you have been adding in the search and pagination section, where users can use the front-end filter controls to modify the results of the View.

Now, when you create a new View and specify that this will be a custom search View, the Query Filter section is normally hidden. You can expose it by using the Screen Options tab at the very top of the page and checking the Query Filter checkbox.

Now, when adding a front end filter using the New Filter button, hidden from sight, Views quietly adds a Query Filter for that filter control which specifies that it is listening to the relevant URL parameter for the filter value.

Because the Query Filter section is normally hidden you don't notice that, but if you expose the Query Filter section and use the New Filter button to add filter controls, you'll see that a new Query Filter is added each time.

But look at the Query Filter section for your Single Product List Entry View. It is empty. You have front-end filter controls, but they don't do anything, because there are no Query Filters listening to the URL parameters added by these filter controls.

I don't know how you ended up in this position, but the best way to fix it is to delete the filter controls from the Search and Pagination section, and then use the New Filter button to add them back, one by one, checking that a corresponding filter is being added to the Query Filter section.

Try that, and when you see that it is working, you can activate the code snippet that will prevent any results being shown until something has been searched for.

#1152007

Nigel,

You would not have disturbed me because I have been awake, anxious and in a state of panic over this project for a long time now.

First, I appreciate your help more than I can express. Secondly, I arrived at this filter configuration by attempting to follow the fragments of articles and tutorials. Also, in past support ticket posts, I asked specifically about the difference between form end form filters and admin filters at least twice but the question was never answered.

I am overwhelmed by this update.

You are now instructing me to remove all of the HTML in the "Search and Pagination" (where there are MANY, MANY support tickets discussing that work flow with support agents) and delete it. Then you are instructing me to re-add the fields in the Query Filter Section where there is a drop-down with a long list of elements that I have no idea what they are but you say that this is what I must do. And all of this just a couple of hours before you "Weekend Mode".

If this is what you are truly stating , the heart break for me is I do not think I can afford to hold o any longer and the client has lost his patience.

You say to try that as if it's simply a drop of water. I thought this project was shaping up but actually there was a fatal point that I just had not seen yet.

Toolset articles, tutorials and support lead me to this exact position I am in today.

#1152013

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+00:00)

Hi Chuck

I'm sorry this is proving so difficult.

Let me clarify one thing, I'm not asking you to do quite what you say.

Yes, you are going to need to remove the markup from the Search and Pagination section, but you will be adding back to the same place (using the New Filter button), which will automatically insert the Query Filters that are currently missing.

You can do it one at a time.

See in my screenshot, I have highlighted just the HTML & shortcodes which are inserted by Views when you add a filter.

So starting with that one, you would delete the highlighted section, and then with the cursor in the same place, use the New Filter button to add the same filter back again.

When you've done that, double-check that a Query Filter was added (back up the same page), and if so, proceed with the other filters, one at a time.

That should leave the markup and styling you have come up with so far for the filters intact, but the filters will then work.

#1152018

I appreciate your help and I see your sincerity.

I need an hour or so to process your update and instructions. Please try to check back on this case before the "weekend mode" to see where I am at, please.

Thank you Nigel.

#1152064

Nigel,

You refer to a screenshot but I do not see one?

Also, can we conclude that it is not a third party plugin at this point? I have a couple of plugins that I would like to reactivate if there is no conflict.

#1152068

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+00:00)

Screenshot 2018-11-23 at 13.59.39.png

Sorry, here is the screenshot.

And, yes, you can re-activate the plugins as required, it was not the issue after all.

#1152094

Ok. Thank you for clarifying. So I'm going to do this div by div.

I will give this a try.

#1152129

Nigel,

Is this also the reason why Results display immediately upon the page loading even after we added and edited the code previous code snippet or is that caused by something else?

I personally have never seen a search form that displays results before I submitted a search form.

#1152131
Screenshot_11-23-2.jpg

I do not know how this can be, but there is NO field in my "Form Group" field options. The only Product Category option is in the Taxonomy filters but it does not start with

<div class="form-group">
<label>[wpml-string context="wpv-views"]Category[/wpml-string]</label><br>

When I add the Product Category that appears in the Taxonomy this is what appears in the code without div brackets or a label:

[wpml-string context="wpv-views"]Product categories[/wpml-string]
[wpv-control-post-taxonomy taxonomy="product_cat" type="select" default_label="Select" url_param="wpv-product_cat" output="legacy"]

The original code I was instructed to delete was:

<div class="form-group">
<label>[wpml-string context="wpv-views"]Category[/wpml-string]</label><br>
[wpv-control-post-taxonomy taxonomy="product_cat" type="select" default_label="Select" url_param="wpv-product_cat" output="legacy"]
</div>

With this simple difference how can I proceed without making yet another mistake and wasting more time?

#1152136

You have super admin access can you please set the first field as an example so I can have something to follow?

#1152143

Can you please take a look at this?

I have absolutely NO example to follow in setting this up which is insanity.

There were no Min Price and Max Price price filters available to select from in the "New Filter" tab.

This is not everyday knowledge. It's a major disservice to subscribers to not have full documentation in this!!!

#1152149

Nigel,

I know the world does not revolve around my project but if you can please give this another look before the two-day weekend mode I would really appreciate it.

#1152163

Nigel,

I did the following exactly as directed (considering the path was not as described):

"So starting with that one, you would delete the highlighted section, and then with the cursor in the same place, use the New Filter button to add the same filter back again.

When you've done that, double-check that a Query Filter was added (back up the same page), and if so, proceed with the other filters, one at a time.

That should leave the markup and styling you have come up with so far for the filters intact, but the filters will then work."

The only three fields I could not replace were the three in the last row for min price, max price, and blank keyword fields. They were not among those available in the "New filter" link.

The form not only does not work still but now the results that were auto-populated before, no longer appear. When I enter a simple search, the page resets to the top header again.

ABSOLUTELY NOTHING!