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

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.