Bug in EShop Breadcrumbs – language not applied correctly

More
3 weeks 2 days 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.

  • Giang Dinh Truong
  • Offline
  • Administrator
  • Administrator
More
3 weeks 6 hours ago #176507 by Giang Dinh Truong
Replied by Giang Dinh Truong on topic Bug in EShop Breadcrumbs – language not applied correctly
Dear Chris,

Thank you for figured this out and reporting us. That's correct. I will update the fix to the next version of EShop.

Sincerely, Giang
The following user(s) said Thank You: Christoph

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

Moderators: Giang Dinh Truong