Skip to content

Commit

Permalink
Update CatalogBreadcrumbTrait.php (#3192)
Browse files Browse the repository at this point in the history
Add locale var for getTitle...
  • Loading branch information
Elyos59 committed Apr 26, 2024
1 parent 3b94075 commit 80c8cbc
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions core/lib/Thelia/Model/Breadcrumb/CatalogBreadcrumbTrait.php
Expand Up @@ -19,7 +19,7 @@

trait CatalogBreadcrumbTrait
{
public function getBaseBreadcrumb(Router $router, $categoryId)
public function getBaseBreadcrumb(Router $router, $categoryId, $locale)
{
$translator = Translator::getInstance();
$catalogUrl = $router->generate('admin.catalog', [], Router::ABSOLUTE_URL);
Expand All @@ -42,7 +42,7 @@ public function getBaseBreadcrumb(Router $router, $categoryId)
if ($category != null) {
$results[] = [
'ID' => $category->getId(),
'TITLE' => $category->getTitle(),
'TITLE' => $category->setLocale($locale)->getTitle(),
'URL' => $category->getUrl(),
];

Expand Down Expand Up @@ -81,7 +81,7 @@ public function getProductBreadcrumb(Router $router, $tab, $locale)
/** @var \Thelia\Model\Product $product */
$product = $this->getProduct();

$breadcrumb = $this->getBaseBreadcrumb($router, $product->getDefaultCategoryId());
$breadcrumb = $this->getBaseBreadcrumb($router, $product->getDefaultCategoryId(), $locale);

$product->setLocale($locale);

Expand All @@ -103,7 +103,7 @@ public function getCategoryBreadcrumb(Router $router, $tab, $locale)

/** @var \Thelia\Model\Category $category */
$category = $this->getCategory();
$breadcrumb = $this->getBaseBreadcrumb($router, $this->getParentId());
$breadcrumb = $this->getBaseBreadcrumb($router, $this->getParentId(), $locale);

$category->setLocale($locale);

Expand Down

0 comments on commit 80c8cbc

Please sign in to comment.