@@ -277,6 +277,7 @@ protected function _getStream()
277
277
* @param DataObject $sitemapItem
278
278
* @return $this
279
279
* @deprecated
280
+ * @see ItemResolverInterface
280
281
*/
281
282
public function addSitemapItem (DataObject $ sitemapItem )
282
283
{
@@ -290,10 +291,37 @@ public function addSitemapItem(DataObject $sitemapItem)
290
291
*
291
292
* @return void
292
293
* @deprecated
294
+ * @see ItemResolverInterface
293
295
*/
294
296
public function collectSitemapItems ()
295
297
{
298
+ /** @var $helper \Magento\Sitemap\Helper\Data */
299
+ $ helper = $ this ->_sitemapData ;
300
+ $ storeId = $ this ->getStoreId ();
296
301
302
+ $ this ->addSitemapItem (new DataObject (
303
+ [
304
+ 'changefreq ' => $ helper ->getCategoryChangefreq ($ storeId ),
305
+ 'priority ' => $ helper ->getCategoryPriority ($ storeId ),
306
+ 'collection ' => $ this ->_categoryFactory ->create ()->getCollection ($ storeId ),
307
+ ]
308
+ ));
309
+
310
+ $ this ->addSitemapItem (new DataObject (
311
+ [
312
+ 'changefreq ' => $ helper ->getProductChangefreq ($ storeId ),
313
+ 'priority ' => $ helper ->getProductPriority ($ storeId ),
314
+ 'collection ' => $ this ->_productFactory ->create ()->getCollection ($ storeId ),
315
+ ]
316
+ ));
317
+
318
+ $ this ->addSitemapItem (new DataObject (
319
+ [
320
+ 'changefreq ' => $ helper ->getPageChangefreq ($ storeId ),
321
+ 'priority ' => $ helper ->getPagePriority ($ storeId ),
322
+ 'collection ' => $ this ->_cmsFactory ->create ()->getCollection ($ storeId ),
323
+ ]
324
+ ));
297
325
}
298
326
299
327
/**
@@ -304,7 +332,6 @@ public function collectSitemapItems()
304
332
protected function _initSitemapItems ()
305
333
{
306
334
$ sitemapItems = $ this ->itemResolver ->getItems ($ this ->getStoreId ());
307
- $ this ->collectSitemapItems ();
308
335
$ mappedItems = $ this ->mapToSitemapItem ();
309
336
$ this ->_sitemapItems = array_merge ($ sitemapItems , $ mappedItems );
310
337
@@ -791,7 +818,7 @@ private function mapToSitemapItem()
791
818
$ items = [];
792
819
793
820
foreach ($ this ->_sitemapItems as $ data ) {
794
- foreach ($ data ->getCollection () as $ item ) {
821
+ foreach ($ data ->getCollection () as $ item ) {
795
822
$ items [] = $ this ->sitemapItemFactory ->create ([
796
823
'url ' => $ item ->getUrl (),
797
824
'updatedAt ' => $ item ->getUpdatedAt (),
0 commit comments