Skip Navigation

[Resolved] only show specific categories in dropdown filter

This support ticket is created 5 years, 4 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 8 replies, has 2 voices.

Last updated by giorgosK 5 years, 4 months ago.

Assisted by: Nigel.

Author
Posts
#1193558

I am trying to: make a category filter to show certain categories

Link to a page where the issue can be seen: elastikagiannoulis.gr

I expected to see: the categories i have selected in the filter options

Instead, I got: all categories showing up

#1193580

hello i have a search on the home page hidden link

when we land on the search result page hidden link

i have set up filters for manufacturers and categories in the search results page

1. problem : when i select a manufacturer images disappear and it does not filter only the selected manufacturer
hidden link

2. problem : i tried to set up the category filter to show certain categories
hidden link

but the filter shows all the categories hidden link

here is also the shortcode in search and pagination field

[wpv-conditional if="( NOT(EMPTY([wpv-search-term param='wpv_post_search'])) )"] 

 <div class="form-group">
	[wpv-control-post-taxonomy default_label="ΚΑΤΑΣΚΕΥΑΣΤΗΣ" output="bootstrap" class="ela1" taxonomy="pa_manufacturer" type="select" url_param="wpv-pa_manufacturer"] 
</div>
  
  <div class="form-group">
	[wpv-control-post-taxonomy taxonomy="product_cat" type="select" default_label="ΚΑΤΗΓΟΡΙΑ" output="bootstrap" class="ela1" url_param="wpv-product_cat"]
</div>

[/wpv-conditional]
#1193640

Nigel
Supporter

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

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

Let me answer the second question first, as that is expected.

Views does not offer any way to modify what terms are included in a taxonomy filter. If you insert a filter for a taxonomy (e.g. the pa_manufacturer taxonomy) then all of the terms of that taxonomy are included in the filter. The only way it would be possible to change that would be by using JavaScript on the front-end to remove the unwanted options.

What you show in your screenshot is not to choose which terms to include in the filter, it is a "backend" Query Filter that specifies which terms to apply to the query for posts every time the View is loaded, it has nothing to do with front-end searches.

Imagine you had a post type that used a "status" custom taxonomy with terms "published" and "unpublished". You could add a Query Filter for the status taxonomy and manually select the "published" term, and then you could display that View wherever you want and it would only ever show "published" posts.

The first question is trickier, because it is not expected, what you report. I'll need to take a closer look at how you set up the Views. You have provided access to your site, so I will do that now, and report back to you soon.

#1193645

Nigel
Supporter

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

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

elastikagiannoulis.gr_wp-admin_admin.php_page=views-editor&view_id=1145.png

You can see in this screenshot why the results were not updating correctly: the URL parameter that will be added by the front-end filter control needs to correspond to the URL parameter that the Query Filter is listening to.

I updated the product category Query Filter so that it is again set by the filter control (blue), and I have fixed the mismatched parameters for the other taxonomy (red).

The product image is still disappearing though, I'm checking that now.

#1193651

Nigel
Supporter

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

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

Screenshot 2019-01-31 at 11.55.39.png

I noticed using the browser dev tools that the image is included, but the product gallery has an opacity of zero (screenshot).

Before I set up a similar test on my local site, are there any customisations you are aware of that might account for this?

Can you check if the same occurs if you disable all non-Toolset plugins except for WooCommerce, and switch theme to twentynineteen?

#1193666

thank you for yout time and support.

i have set also a stage website hidden link

were Minish worked and supported me yesterday

there the image is present.

the problem on the live site occured when i transfered his work and modifications to the live site, what i did was copy the code from the view to the live site

#1193691

Nigel
Supporter

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

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

It works if the View updates via page load instead of the current ajax update setting.

Is that the difference between your staging site and your live site?

(I couldn't look at the staging site as the credentials are different from the live site.)

#1193706

yes it works now! thank you, yes that was the difference with the stage site.

thank you for your support!

#1193707

My issue is resolved now. Thank you!

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