Sauter la navigation

[Résolu] filter category hierarchy

This support ticket is created Il y a 4 années et 1 mois. 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
- 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10: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: Asia/Kolkata (GMT+05:30)

Ce sujet contient 14 réponses, a 2 voix.

Dernière mise à jour par Minesh Il y a 4 années.

Assisté par: Minesh.

Auteur
Publications
#1909037

Hi,

i have a view of CPT with hierarchical categories (2 Levels) - Can i set the Filter to show the Parent Category of an Subcategory if its fiterable?

This is Filter of the View
[wpv-control-post-taxonomy taxonomy="produktkat" type="checkboxes" format="%%NAME%% | %%COUNT%%" orderby="term_group" url_param="wpv-produktkat"]

here you can see the case:

lien caché

thx - best regards - alex

#1909173

Minesh
Supporter

Les langues: Anglais (English )

Fuseau horaire: Asia/Kolkata (GMT+05:30)

Hello. Thank you for contacting the Toolset support.

I'm not sure yet what exactly you want. Do you mean that you want to display the taxonomy term parent with each subcategory? or you want to display terms in parent->child hierarchy?

#1909181

Hi Minesh,

yes, i want to show the parent-Category-Name over grouped Subkategorie-Filter or display terms-filter in parent->child hierarchy.

can you help me?

thx - alex

#1909183

Minesh
Supporter

Les langues: Anglais (English )

Fuseau horaire: Asia/Kolkata (GMT+05:30)

Can you please send me access details so I can check how exactly you configured your view?

*** Please make a FULL BACKUP of your database and website.***
I would also eventually need to request temporary access (WP-Admin and FTP) to your site. Preferably to a test site where the problem has been replicated if possible in order to be of better help and check if some configurations might need to be changed.

I have set the next reply to private which means only you and I have access to it.

#1909195

Minesh
Supporter

Les langues: Anglais (English )

Fuseau horaire: Asia/Kolkata (GMT+05:30)

Unfortunately - the admin access details you send to me is not working at this end.

Can you please send me working admin access details.

I have set the next reply to private which means only you and I have access to it.

#1909217

Minesh
Supporter

Les langues: Anglais (English )

Fuseau horaire: Asia/Kolkata (GMT+05:30)

Sorry but with the test site for which you shared the access details: lien caché

Where I can find the page which you shared with your initial post?
=> lien caché

I do not find that page.

#1909221

oh sorry - the admin is on lien caché

and
lien caché

is "Produktfilter"

#1909249

Minesh
Supporter

Les langues: Anglais (English )

Fuseau horaire: Asia/Kolkata (GMT+05:30)

Can you please check now: lien caché

I've set your view's "Custom Search settings " to "Let me choose individual settings manually" and "Always show all values for inputs".

I can see now terms hierarchy.

#1909261

Hey - oh nice - thx!

Can you tell me if i can hide emty subcategories?

#1909267

Minesh
Supporter

Les langues: Anglais (English )

Fuseau horaire: Asia/Kolkata (GMT+05:30)

With Custom Search Settings - either you can select " Show only available options for each input", that will only display the terms for available results and hence it will not display the parent category and that is why if you want to display terms hierarchy you will have to go with option ""Always show all values for inputs".

#1909307

ok - what is a workaround? Can i add an class to empty Categories or can i do this with jquery? What do you think?

#1909413

Minesh
Supporter

Les langues: Anglais (English )

Fuseau horaire: Asia/Kolkata (GMT+05:30)

I think jQuery would be better solution.

I've added the following jQuery code to your view's "Search and Pagination" sections JS editor:

jQuery(document).ready(function($){
  
  $(".children li:contains(0)").hide();

});

jQuery( document ).on( 'js_event_wpv_parametric_search_results_updated', function( event, data ) {
	/**
	* data.view_unique_id (string) The View unique ID hash
	* data.layout (object) The jQuery object for the View layout wrapper
	*/
  jQuery(".children li:contains(0)").hide();
	
});

Can you please confirm it works as expected 🙂

#1909415

Hey Minesh - thats great! - Thank you very much!. - warmly, alex

#1913029

Hey Minesh,

is it possible to do the Filter on my Productarchiv that i see only the Subkategories to Filter?
Here: lien caché

its a post you gave support -> here: https://toolset.com/forums/topic/set-up-product-archive-with-filter/page/2/

best regards - alex

Les nouveaux fils créés par Minesh et associés à celui-ci sont repris ci-dessous :

https://toolset.com/fr/forums/topic/split-filter-category-hierarchy-show-only-subcategories-as-filter/

#1913037

Minesh
Supporter

Les langues: Anglais (English )

Fuseau horaire: Asia/Kolkata (GMT+05:30)

I've split the ticket with your new question as a new ticket, I will follow up on the following ticket:
=> https://toolset.com/forums/topic/split-filter-category-hierarchy-show-only-subcategories-as-filter/