Skip Navigation

[Resolved] Curent taxonomy full tree view for product archive

This support ticket is created 2 years, 7 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
- 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9: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/Hong_Kong (GMT+08:00)

This topic contains 1 reply, has 2 voices.

Last updated by Luo Yang 2 years, 7 months ago.

Assisted by: Luo Yang.

Author
Posts
#2361741

Hi,

I wonder if it would be possible to create with Toolset a view or views to be used in the product archive page, that lists links to the current category parent as well as current brother and child categories. It's a multilevel taxonomy with upto 4 levels of depth.

The closest we've come is by using the Product category widget, that displays the whole category tree, and show only the 'current cat' items. But this is not ideal as we are just hidding what we don't want with styles

#2362315

Hello,

There isn't such kind of built-in feature within Toolset plugins, it needs custom codes, for example, you can get terms of current post :
https://developer.wordpress.org/reference/functions/wp_get_post_terms/
Use those term's IDs to get the parent term's ID:
https://wordpress.stackexchange.com/questions/165270/get-parent-id-by-term-id
With the parent term's IDs, get the brother term's IDs:
https://developer.wordpress.org/reference/functions/get_term_children/
With current post term's IDs, get there child term's IDs.