File tree 1 file changed +12
-3
lines changed
packages/core/src/components/templates/ProductListingPage
1 file changed +12
-3
lines changed Original file line number Diff line number Diff line change @@ -81,6 +81,17 @@ export default function ProductListingPage({
81
81
const [ pathname ] = router . asPath . split ( '?' )
82
82
const canonical = `${ storeConfig . storeUrl } ${ pathname } `
83
83
const itemsPerPage = settings ?. productGallery ?. itemsPerPage ?? ITEMS_PER_PAGE
84
+ let itemListElements = collection ?. breadcrumbList . itemListElement ?? [ ]
85
+
86
+ if ( itemListElements . length !== 0 ) {
87
+ itemListElements = itemListElements . map (
88
+ ( { item : pathname , name, position } ) => {
89
+ const pageUrl = storeConfig . storeUrl + pathname
90
+
91
+ return { name, position, item : pageUrl }
92
+ }
93
+ )
94
+ }
84
95
85
96
return (
86
97
< SearchProvider
@@ -100,9 +111,7 @@ export default function ProductListingPage({
100
111
description,
101
112
} }
102
113
/>
103
- < BreadcrumbJsonLd
104
- itemListElements = { collection ?. breadcrumbList . itemListElement ?? [ ] }
105
- />
114
+ < BreadcrumbJsonLd itemListElements = { itemListElements } />
106
115
107
116
< ProductListing
108
117
globalSections = { globalSections }
You can’t perform that action at this time.
0 commit comments