Skip Navigation

[Resolved] Search Results not updating properly

This support ticket is created 7 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
- 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+01:00)

This topic contains 4 replies, has 2 voices.

Last updated by tomA-4 7 years, 10 months ago.

Assisted by: Nigel.

Author
Posts
#401766

I am trying to: Search my products by product attributes. I have set up a search for the items, so that they can be filtered by product attributes. (wood, item diameter, Item height)
I cannot get the search to work properly not matter how i set it up.
I have enabled all the parametric update settings in the views settings.

If I set the search to use AJAX update then the results field goes blank when I change a value in the search dropdown. I can see the URL in the address bar does not show the filter values until after the blank results load. the results only appear if I refresh the page.

If I set the search to full page refresh when you click the search button, the button will not update the search results, instead it links to a single product page.

I can see the URL in the address bar does not show the filter values until after the blank results load.

I will leave the views archive template active today so you can see what I mean, but as much as I want to use my own layout for category archives , I will have to go back to the woocommerce default page if I cannot fix this.
Any ideas?
thanks,
tom

I visited this URL: hidden link

#402185

Nigel
Supporter

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

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

Hi Tom

Sorry for the delay getting back to you, I spent quite a bit of time testing because I wanted to be clear on what you can and cannot do in this situation.

What I'm not clear about from your question is where you are trying to add your parametric search.

I had no problems recreating your scenario and adding the parametric search to a dedicated static page. I'll run through the steps below if you have had problems doing this so you can see if anything jumps out as different from your own attempts.

But, what you cannot do is replace your archive pages with a parametric search, whether they are standard WordPress archives or WooCommerce archives. If that is what you are trying to do then that is why you will be having problems and you can effectively stop reading here, although there is something of a compromise which I'll describe towards the end.

Here is what I did to create the test parametric search which I added to a static page.

First, I created a few products with the product category "turned wood" with differing attributes for "wood" and "size".

I created a new parametric search View to display products. I only want to show products from my turned wood category, and to be able to add this query (which occurs before the parametric search filter) I needed to go to my Screen Options at the top of the page and indicate I want to see the Query filter section.

I then added a Product Category query filter. For the purposes of this test I am going to first manually select the turned wood category, but I'll come back to this.

Now to my parametric search filters. I add new filters for the taxonomies "wood" and "size" which are my product attributes.

I add something to the Loop section to display some output, in this case I'm just showing the product title, normally I would add more details via a Content Template.

Now my View is finished, I can add it to a page to test that it works (which it does).

The problem here is that I have selected one particular product category ('turned wood') to display on this page.

Here is one possible alternative, and depending how you set up your pages there may be others.

Instead of displaying the parametric search view directly on the static search page, you might create a new taxonomy view for your product categories and nest your parametric search view inside this one, editing the query of the parametric search view to select posts with Product Categories set by the parent Taxonomy View.

I'll stop here, there should be enough to clarify what you can and can't do, and I'll wait for your comments before trying to advise you any further.

#402347

Hi Nigel,
Thanks for all the work you have put into understanding my problem.
Unfortunately, I am in fact trying to use the search in my product archive page, not a static page.
And it almost works, almost....
It should work, at least in a perfect world because what I want to do, i.e. make my products searchable on the archive pages is very useful, and even rudimentary.

If I understand this properly, the problem is that the search is querying the category url.
But the results load before the search terms appear in the url.
After the results load the search term is in the url and when I hit reload everything if the way it should be. Just too many steps for someone browsing my site.

But Shane mentioned to me in another ticket "that parametric search is coming to post archives" in the next release. Maybe that will make it work for me. I hope so.
right now I am getting the job done by using the standard woocommerce search widgets placed in the layout for the product category archive. It works but I think I could do more with the toolset search. If it would work.

if you are curious how it looks with the woocommerce widgets, here is an archive page:hidden link

thanks again.
tom a

#402615

Nigel
Supporter

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

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

Hi Tom

I "almost" got it working too but there is an element of square peg round whole to this.

The next version of Views will add true support for parametric search in WordPress archives which will align the peg and the whole nicely. It is still in testing but we are hopeful that it will be out by next week.

#402760

thanks for the info Nigel,
I look forward to the update

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