diff --git a/src/Provider/TaxonUrlProvider.php b/src/Provider/TaxonUrlProvider.php index 4c0dac3..9db8992 100644 --- a/src/Provider/TaxonUrlProvider.php +++ b/src/Provider/TaxonUrlProvider.php @@ -52,7 +52,7 @@ public function getItems(string $locale): array continue; } $items[] = [ - 'name' => $this->getTaxonFullName($taxon), + 'name' => $taxon->getFullname(' > '), 'value' => $this->router->generate('sylius_shop_product_index', ['slug' => $taxon->getSlug(), '_locale' => $locale]), ]; } @@ -61,20 +61,4 @@ public function getItems(string $locale): array return $items; } - - private function getTaxonFullName(TaxonInterface $taxon): string - { - $fullName = (string) $taxon->getName(); - $parent = $taxon->getParent(); - while (null !== $parent) { - /** @var TaxonInterface $parent */ - if ($parent->isRoot()) { - break; - } - $fullName = $parent->getName() . ' > ' . $fullName; - $parent = $parent->getParent(); - } - - return $fullName; - } }