Hi Giang,
I think I discovered a bug in the EShop component affecting breadcrumbs in multilingual sites. The issue occurs because the language parameter ($langCode) is not passed to the function EShopHelper::getCategoriesBreadcrumb().
I noticed that because I get breadcrumbs with a different language in the second sub category, because of a fallback to the site language (in my case German), so when I chose English I get a German entry after the first sub category in the breadcrumbs.Details:
- Category pages (/components/com_eshop/view/category/html.php - after comment "//Handle breadcrump")
- The code originally did not pass $langCode so it fall back to German even when choosing English:
$paths = EShopHelper::getCategoriesBreadcrumb($category->id, $parentId);
- To fix it, the function should be called like this:
$langCode = Factory::getLanguage()->getTag();
$paths = EShopHelper::getCategoriesBreadcrumb($category->id, $parentId, $langCode);
- This ensures that all category names in the breadcrumb match the current site language.
- 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.
I hope this helps.
Best regards,
Christoph