How using magento 2.1.9 default rss feed generator to generate XML for all products? By default, there are only New, Featured, etc.... but not ALL.
I manually change the cid on feed url (replace top parent category cid), it shows only some of the products, not all.
Is there a bug or misconfiguration on my site?
Any feedback appreciated.
Solved! Go to Solution.
Hello @dennischan,
I guide to you how do you add all products in RSS feeds. I hope you have basic experiece in Magento 2 module create.
vendor/magento/module-catalog/etc/adminhtml/system.xml
vendor/magento/module-rss/Controller/Feed/Index.php
vendor/magento/module-catalog/Block/Rss/Product/NewProducts.php vendor/magento/module-catalog/Model/Rss/Product/NewProducts.php
--
If my answer is useful, please Accept as Solution & give Kudos
Magento natively generates feeds for new, special products.
Here you can find Magento official document: https://docs.magento.com/m2/2.1/ce/user_guide/marketing/rss-feed.html with configurations.
Thanks for your reply. But probably I didn't mention my issue clearly.
I actually am using the Magento built-in configurator as you recommended.
However, my issue is that is not working.
It can generate feeds for new, featured, etc..
But I want ALL products.
I have also tried to use the feed link and change the parameter cid as top level category, by that means, I expect it'll generate a feed for all products, but not. It's working, but it shows only some of the products. I don't know why.
I also dig into the code, inside vendor/module-rss/controller/feed/index.php
i found
/** @var $rss \Magento\Rss\Model\Rss */
$rss = $this->rssFactory->create();
$rss->setDataProvider($provider);
$this->getResponse()->setHeader('Content-type', 'text/xml; charset=UTF-8');
$this->getResponse()->setBody($rss->createRssXml());
I wonder if anyone can point me to somewhere so I can modify the methods of
$rss->setDataProvider($provider);
$rss->createRssXml()
I think I may be able to enhance the feed by modifying some parameters (or modify the SQL) of the methods.
Hello @dennischan,
I guide to you how do you add all products in RSS feeds. I hope you have basic experiece in Magento 2 module create.
vendor/magento/module-catalog/etc/adminhtml/system.xml
vendor/magento/module-rss/Controller/Feed/Index.php
vendor/magento/module-catalog/Block/Rss/Product/NewProducts.php vendor/magento/module-catalog/Model/Rss/Product/NewProducts.php
--
If my answer is useful, please Accept as Solution & give Kudos