Switching “Main term” does not work.
-
Hello there,
I noticed that the “Make primary” functionality doesn’t really make the category primary. I noticed this because our woocommerce breadcrumbs were not showing the right ancestors.
During the generation of the breadcrumbs there is a function that finds the “main term” and gets all the ancestors from there on:
$main_term = apply_filters( 'woocommerce_breadcrumb_main_term', $terms[0], $terms );
class-wc-breadcrumbs.php - line 163
I have a product which has the following category structure: https://i.gyazo.com/1eb40364ccee2f0ed403b4219f376b73.png
As you can see “Pullovers” is the main. Yet this is not properly reflected in the breadcrumb: https://i.gyazo.com/a27a4007b0fbeac48527fb97073d7ec8.png
It is only when I remove “Dames” as a category that the breadcrumb works decent:
Back-end:
https://i.gyazo.com/95505280089aab23f3a87172eae39ca2.pngFront-end:
https://i.gyazo.com/75318a7cff2286ad2f15c0ac24da2ae3.pngHow can I fix it so that even when I have “dames” category selected that the heritage tree is still being loaded correctly?
- The topic ‘Switching “Main term” does not work.’ is closed to new replies.