Skip Navigation

[Resolved] Woocommerce + Toolset views -> Search Filters and Results display issue

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

Problem: I would like to place a custom search View in a WordPress Archive for Product Categories. I would like to show the correct, filtered results on the archive. I would also like to show filters that allow Users to easily filter the list by other Product Categories.

Solution: Something exactly like this is not possible in the current system. Your options are:
1. You can use a WordPress Archive to display the correct, filtered results at URLs like /websites/header. This will work without a View, but then your Users cannot use the search filters to show the other Website options like Footer, Navigation, etc. because a WordPress Archive for the term "header" cannot be filtered to show results for a different term. It is not possible in the current WordPress Archive system. One alternative here is to use a list of links to represent the other terms. They will not work together with other filters, but will allow your Users to easily navigate between term archives.

2. You can use a View to display the correct, filtered results inside a WordPress Archive. This will allow your Users to apply the other Website filter options like Footer, Navigation, etc. but it presents a different problem. Now you cannot filter the initial results automatically because the View only responds to URL parameters. It does not respond to the taxonomy term directory-based URL. One way to get around this problem is to update all the links in your menu to point to the archive pages with the proper URL parameters, like /websites/header?wpv-websites=header or /websites/footer?wpv-websites=footer. Another way to get around this problem may be custom code, but it falls outside the scope of support we provide here.

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

This topic contains 6 replies, has 3 voices.

Last updated by Christian Cox 6 years, 6 months ago.

Assisted by: Christian Cox.

Author
Posts
#920441
screenshot 3.png
screenshot 2.png
screenshot 1.png

I created one view to display woocommerce products based on search filter results, I'm using custom taxonomy category named "Website" for Woocommerce’s Product post type.

[Query filter: set by one URL parameter]

on the search filter I've added filter of Website taxonomy as radio option and on the query filter I've selected set by one URL parameter,
and placed Reset button above this filter.

I want to show category hierarchy in search filter but after selecting any specific category from Website taxonomy, other categories are getting disappeared from search filter as
shown in Screenshot 1, also I want to show only products related to specific category, but all products are appearing as result. After clicking Reset button,
all disappeared categories gets available, this time, clicking on any category comes with relevant results as shown in screenshot 2,

[Query filter: set by the current archive page]

Now if I'm changing to "set by the current archive page" on query filter, here also other categories are getting disappeared but relevant results are coming on category page,
but after clicking Reset and selecting any other category, same results are appearing there as well as shown in screenshot 3.

Is it possible with toolset that click of any category, relevant results should come with category hierarchy [without any category disappearance] in search filter so that user
can switch between other categories and would be able to view the relevant results as shown in screenshot 2.

#920679

Nigel
Supporter

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

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

Screen Shot 2018-07-04 at 07.45.32.png

Hi James

It sounds like the issue is as simple as a Views setting which you can see in the screenshot which you need to change to "Always show all values for inputs".

By default the filter controls update to match the current results of the View.

#920710
Screenshot 2.png
Screenshot 1.png

I've already used that option earlier, right now that option is selected and its working for only for below filters which are Product tags and Product template type.
I want this for function Category filter(Website Toolset), Where the other categories are still not visible, as shown in screenshot 1.

For better understanding, I'm clicking this link which is a one category of Website Taxonomy and please do check from your side as well : hidden link ,

after clicking this to link, I'm only able to see "Header (3)" option as shown in screenshot 1, other sub category and categories are not visible here,
which are getting visible only after hitting reset button as shown in screenshot 2, also it is displaying all results, I need only category specific results, that means
only 3 results should come as shown in Screenshot 2.

So after pressing reset button, it is working fine, I need this same without hitting Reset button, means relevant products should come in result with all other categories options visible as shown in screenshot 2.

#920742

Nigel
Supporter

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

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

I think the problem here is that you are using a View with search filters for taxonomies on a WordPress taxonomy archive page.

I'm guessing you are replacing the archive (not outputting anything from it) with the View, and trying to set the initial results based upon the current archive term, which is problematic.

It would help if I could look at your set up myself to see exactly what you are doing, if I could get access please.

I will mark your next reply as private so that I can get log-in credentials from you—you may want to create a temporary admin user for me to use that you can later delete. And be sure to have a current backup of your site, even though I don't intend to make any changes.

#921254

Nigel
Supporter

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

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

Hi James

Yes, the problem here is that you are on a taxonomy archive page (the Websites (Toolset) archive) but you are not displaying the archive, you are displaying a View with taxonomy filters. The URL (e.g. site.com/websites/header) determines the term for that page (header) which is affecting the View.

You should use the View on a static page instead of the taxonomy archive page.

I inserted it into a test page—View Demo—where you will see that it works correctly as expected. It is its use on the taxonomy archive page that causes the problem.

#921821
Screenshot 2.jpg
Screenshot 1.jpg

I've already done that in this page earlier : hidden link , it is okay for index of search page but I'm also talking about if someone clicks any particular
category page from Website taxonomy ex "Header", user should be able to see the relevant results of specific category as shown in screenshot 1.

For example : User select "Header" option from Mega menu as shown in Screenshot 1, which is a category of Website taxonomy ,
this is the same view which you've used on "view-demo" page is displaying all results here as well as shown in screenshot 2 and even if I'm creating another view for Website taxonomy archive with query filter - "Set by the current archive page" , relevant results are coming by selecting any categories from mega menu but after hitting reset button,
all remaining categories available there are displaying the same result which I had already discussed on the first question.

Hope you understood what I meant, User should also be able to see the category specific results when they select any of category from mega menu.

If we speak on the URL ex. "hidden link" shows all results but it shows right results with the url "hidden link" I want this to work with only slug with out the url parameter.

#922564

Hi Nigel is on vacation this week so I'll be glad to help while he is away. I've reviewed your setup and your questions. Let's review your options:

1. You can use a WordPress Archive to display the correct, filtered results at URLs like /websites/header. This will work without a View, but then your Users cannot use the search filters to show the other Website options like Footer, Navigation, etc. because a WordPress Archive for the term "header" cannot be filtered to show results for a different term. It is not possible in the current WordPress Archive system. One alternative here is to use a list of links to represent the other terms. They will not work together with other filters, but will allow your Users to easily navigate between term archives.

2. You can use a View to display the correct, filtered results inside a WordPress Archive. This will allow your Users to apply the other Website filter options like Footer, Navigation, etc. but it presents a different problem. Now you cannot filter the initial results automatically because the View only responds to URL parameters. It does not respond to the taxonomy term directory-based URL. One way to get around this problem is to update all the links in your menu to point to the archive pages with the proper URL parameters, like /websites/header?wpv-websites=header or /websites/footer?wpv-websites=footer. Another way to get around this problem may be custom code, but it falls outside the scope of support we provide here.

Let me know if you have questions about either approach.