Skip Navigation

[Resuelto] Curent taxonomy full tree view for product archive

This support ticket is created hace 2 años, 6 meses. 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.

Hoy no hay técnicos de soporte disponibles en el foro Juego de herramientas. Siéntase libre de enviar sus tiques y les daremos trámite tan pronto como estemos disponibles en línea. Gracias por su comprensión.

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)

Este tema contiene 1 respuesta, tiene 2 mensajes.

Última actualización por Luo Yang hace 2 años, 6 meses.

Asistido por: Luo Yang.

Autor
Mensajes
#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.