how to remove product category slug but show all the slug category terms and the sub-category woocommerce

29 Views Asked by At

so I followed this post, and it worked fine. but not with sub-categories.

the first of 2nd sub categories works fine, but if the sub-category more than 2, it return 404. take a look at this :

  • I have this breadcrumb, each can be clicked (cause it's a sub-category)
  • Like I said, the first of 2nd sub categories can be clicked, but the rest, it returns 404. the first of 2nd is test1 and test2-productcat (home is not count).
  • enter image description here

so far I've tried :

  • var_dump the first breadcrumb (test1) and it shows like this :
array(2) { ["page"]=> string(0) "" ["name"]=> string(5) "test1" }
  • var_dump the second breadcrumb (test2-productcat) :
array(1) { ["attachment"]=> string(16) "test2-productcat" }
  • after that it just return 404, like this
array(1) { ["error"]=> string(3) "404" }

why it behave like this? I mean the first is return page, second return attachment? is it possible to do like I want to achive?

thank you.

EDIT : if you guys wonder how i manage the categories, I set the categories like this :

  • test1 parent category for test2-productcat
  • test2-productcat is a child of test1
  • test3-product-cat is a child of test2-productcat
  • jepitan-pin-rambut is a child of test3-product-cat
  • an so on

Anyone? I still can't figure it out...

1

There are 1 best solutions below

0
Fajar Alam On

ok, so i find a dolution for this. just use plugin permalink manager for woocommerce. and voila it works relly well.