How do I select parent or child when using terms query loop?

Hi,

Trying to narrow down which categories are shown by parent/child categories in a query loop.

How do I define which one in the loop? Do I just write the name of the category or what do I need to do?

image

Hi Erik,
Welcome to the forum!

You can use the term ID instead of the name.

Best regards,
timmse


Hi @timmse ,
I am trying to do something similar. The thing is, that “parent” does not affect the query in my case - it still lists all the available categories, not just the child categories of the current product category.

Sorry that I need to bring this up again - did anyone try this? All I would like to do is loop through the subcategories of the current product category to list all the subcategories. I can not imagine that the loop builder is not capable of doing this.

Hey Alexa,
sorry, I bookmarked the thread - but haven’t gotten around to looking into it yet. I’ll get back to you as soon as I can give you a satisfactory answer :slight_smile:

1 Like

Hi Alexa,

Just tested this in 1.5 Beta and it works fine here.

Make sure you are setting this up in a Template that applies to all terms of Product categories.

Hi @Alexa.

Did You managed to get this to work? I´m facing the same issue… Using {term_id} in the ‘Parent’ field has no effect. Using a fixed value works well. :roll_eyes:

Hi Sridhar.

Could You explain this a little further?

I´m at the same point as Alexa is / was. If I set the parent id as a fixed value (122) it looks good - but using ‘{term_id}’ results in displaying the all categories starting from the alphabetic first.