File tree 1 file changed +11
-1
lines changed
view/frontend/templates/product
1 file changed +11
-1
lines changed Original file line number Diff line number Diff line change 5
5
*/
6
6
declare (strict_types=1 );
7
7
8
+ use Magento \Catalog \Helper \Data as CatalogHelper ;
8
9
use Magento \Catalog \ViewModel \Product \Breadcrumbs ;
9
10
use Magento \Framework \Json \Helper \Data ;
10
11
use Magento \Theme \Block \Html \Breadcrumbs as BreadcrumbsBlock ;
@@ -18,7 +19,16 @@ $viewModel = $block->getData('viewModel');
18
19
$ config = $ block ->getData ('breadcrumbsConfig ' );
19
20
?>
20
21
<?php if ($ config ->isServerSideRendered ()): ?>
21
- <?= $ block ->fetchView ($ block ->getTemplateFile ('Magento_Theme::html/breadcrumbs.phtml ' )) ?>
22
+ <?php
23
+ /** @var CatalogHelper $catalogHelper */
24
+ $ catalogHelper = $ this ->helper (CatalogHelper::class);
25
+ /** @var BreadcrumbsBlock $breadcrumbs */
26
+ $ breadcrumbs = $ block ->getLayout ()->createBlock (BreadcrumbsBlock::class);
27
+ foreach ($ catalogHelper ->getBreadcrumbPath () as $ name => $ crumb ) {
28
+ $ breadcrumbs ->addCrumb ($ name , $ crumb );
29
+ }
30
+ ?>
31
+ <?= $ breadcrumbs ->toHtml () ?>
22
32
<?php else : ?>
23
33
<div class="breadcrumbs"></div>
24
34
<?php endif ; ?>
You can’t perform that action at this time.
0 commit comments