Skip to content

Commit cec0011

Browse files
JoostWanpeterjaap
authored andcommitted
Get all documents for the Magento Sitemap
1 parent c5c2016 commit cec0011

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

Model/ItemProvider/PrismicPages.php

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,17 @@ public function getItems($storeId): array
7373
['lang' => $this->configuration->getContentLanguage($store)]
7474
);
7575

76-
$this->addDocumentsToSitemap($localeDocuments->results, $store);
76+
foreach (range(1, $localeDocuments->total_pages) as $page) {
77+
$documents = $api->query(
78+
[Predicates::at('document.type', $sitemapContentType)],
79+
[
80+
'lang' => $this->configuration->getContentLanguage($store),
81+
'page' => $page
82+
]
83+
);
84+
85+
$this->addDocumentsToSitemap($documents->results, $store);
86+
}
7787
}
7888

7989
return $this->sitemapItems;

0 commit comments

Comments
 (0)