From 7d5cf6f0bb5caec31fa1d8d68ac18b44664eae43 Mon Sep 17 00:00:00 2001 From: Thomas Klein Date: Wed, 28 Aug 2024 23:16:37 +0200 Subject: [PATCH] Fix product breadcrumbs generation for luma --- view/frontend/templates/product/breadcrumbs.phtml | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/view/frontend/templates/product/breadcrumbs.phtml b/view/frontend/templates/product/breadcrumbs.phtml index 0c00404..3ae48e0 100644 --- a/view/frontend/templates/product/breadcrumbs.phtml +++ b/view/frontend/templates/product/breadcrumbs.phtml @@ -5,6 +5,7 @@ */ declare(strict_types=1); +use Magento\Catalog\Helper\Data as CatalogHelper; use Magento\Catalog\ViewModel\Product\Breadcrumbs; use Magento\Framework\Json\Helper\Data; use Magento\Theme\Block\Html\Breadcrumbs as BreadcrumbsBlock; @@ -18,7 +19,16 @@ $viewModel = $block->getData('viewModel'); $config = $block->getData('breadcrumbsConfig'); ?> isServerSideRendered()): ?> - fetchView($block->getTemplateFile('Magento_Theme::html/breadcrumbs.phtml')) ?> + helper(CatalogHelper::class); + /** @var BreadcrumbsBlock $breadcrumbs */ + $breadcrumbs = $block->getLayout()->createBlock(BreadcrumbsBlock::class); + foreach ($catalogHelper->getBreadcrumbPath() as $name => $crumb) { + $breadcrumbs->addCrumb($name, $crumb); + } + ?> + toHtml() ?>