Bug in EShop Breadcrumbs – language not applied correctly

More
23 hours 53 minutes ago #176437 by Chris
Hi Giang,

I discovered a bug in the EShop component affecting breadcrumbs in multilingual sites. I got a mixture of English and German. The issue occurs because the language parameter ($langCode) is not passed to the function EShopHelper::getCategoriesBreadcrumb().Details:
  1. Category pages (view/category/html.php in the breadcrumbs section)
    • The code originally did not pass $langCode,
    • To fix it, the function should be called like this:$langCode = Factory::getLanguage()->getTag();
      $paths = EShopHelper::getCategoriesBreadcrumb($category->id, $parentId, $langCode);
    • This ensures that category names in the breadcrumb match the current site language.
  2. Product pages (view/product/html.php)
    • The same problem exists here. Originally, the code called:$paths = EShopHelper::getCategoriesBreadcrumb($categoryId, $parentId);
    • Since $langCode was missing, the breadcrumb always displayed the default language (usually German), even if the page was in English.
    • The fix is to pass the current language explicitly:$langCode = Factory::getLanguage()->getTag();
      $paths = EShopHelper::getCategoriesBreadcrumb($categoryId, $parentId, $langCode);
    • After this change, both the parent categories and the product’s direct category appear correctly in the current language.
Best regards,
Christoph

Please Log in or Create an account to join the conversation.

Moderators: Giang Dinh Truong