WC sub-categories in "Terms (cloud)"

Hi everyone,
I would like to use the element “Terms (cloud)” to view the list of subcategories of a specific category, instead now (having set the “All terms> Product categories” option in the looper I see them all).

For example, on this page: https://aggroupshop.it/categoria-prodotto/tecnologie/ I would like that the “Terms (cloud)” element to show ONLY the subcategories of “Technologies” (which are 7).
It’s possible?

Hi @scenaryo,

Thanks for reaching out.

Yes, it is possible to show the subcategories of the Woocomerce category, please check the article below explaining on how to set it up.

Hope that helps.

Thank you.

Hi @marc_a,
I followed the guide you indicated but without success.
I tried to choose both “Current post terms” and “Current Page Children” but it doesn’t seem to work.
Could you help me please?

Hi @scenaryo,

To show the Terms Cloud element only on the Technologies terms, you need to add the condition to that element for the specific term by using the Condition attribute under the Customize tab.

If you want to show only the Terms Cloud for Technologies terms, you need to specify that to the Looper Provider of the List element under the Terms element.

Hope it helps.
Thanks

Sorry, I tried following your directions, but it doesn’t seem to work.
As you can see from the screenshot, if I select the taxonomy “Ag Derm” three identical “cloud boxes” are displayed.
1

I try to explain in detail what I would like to do:

I have a WooCommerce category called Tecnologie.
Within this category there are 7 sub-categories, namely:
Tecnologie Per Uso Domiciliare
Tecnologia solo viso
Laser diodo
PressoTerapia
Radio Frequenza Viso e Corpo
Ultrasuoni Viso
Autoclave Classe B

I would like to see ONLY these 7 Terms cloud on the Tecnologie page, as in this image that I recreated with Photoshop:

I would also like this to apply to every category.

I will send you the login credentials via secure note in case you want to take a look at the Layout (it’s called “Shop”).
Thanks in advance :pray:

Hi @scenaryo,

I went ahead and created an Archive template and the Terms Cloud in your website with specific taxonomy and condition to show only into that specific taxonomy only. I would request you to change the taxonomy to your desired one and try by assigning the layout to specific terms.

Hope it helps.
Thanks

Hi @tristup,
Thank you for your answer; I tried to follow your instructions but it doesn’t seem to work (https://aggroupshop.it/categoria-prodotto/cosmetica/)


Where did I go wrong?

Hello @scenaryo,

Sorry for the confusion, the condition should a custom string:

And then make sure that your Shop layout is also assigned to the WooCommerce archive pages.

Check your Technologie product archive page now.

Sorry but unfortunately it still doesn’t work as it should.
I followed the instructions but as you can see on the “Tecnologie” archive page, a list of identical terms appears instead of the subcategories:



Hi @scenaryo,

With the help of my colleague @tristup, we are able to come with a solution using the custom Looper Provider to solve your issue.

1.) First, I activated your child theme and add this custom filter below in your child theme functions.php

add_filter('cs_looper_custom_subcat', function($result, $args) 
 {
 
$category = get_queried_object();
 
  $cat_args = array(
    'hide_empty' => 1,
    'child_of'=> $category->term_id,
    'taxonomy' => 'product_cat',
    
  );
  
  $subcats = get_categories($cat_args);
return $subcats;
}, 10, 2);

that filter will get all the subcategories of a specific category.

2.) Enable the custom in the Looper Provider and add a hook name subcat it is base on the custom filters we added in your child theme functions.php

image

3.) Remove all the string conditions you added from the above response so that it will apply to all categories.

4.) Your category page is now showing its sub-categories, see the example below:

Hope that helps.

Thank you.

1 Like

Hi @marc_a and @tristup,
it works like a charm!!! :partying_face:
Thank you so much, you are great :pray: :hearts:

1 Like

Hi @scenaryo,

You’re welcome and it’s our pleasure to help you. If you have any other concerns regarding our theme features, feel free to reach us.

Thank you.

1 Like

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.