I'm currently working with a Magento 1.9.x Community Edition instance, trying to get an AvantLink metric tracking system to work properly. Most of the work has been done; they're seeing the calls to their tracking script from the success.phtml page with no issues. The problem is that they also need access to an RSS feed (they prefer Google Shopping format, I guess, but said that the standard RSS as is built in to Magento would be fine as well [legacy?]), and that can provide data on our products.
After making certain that all of the RSS capabilities [built in] were enabled, I gave them the URL, and they were able to successfully pull the feed. Unfortunately, while the feed gives them some of what they need, they are still missing the following vital bits of information:
- id
- product_type
- image_link
- price
- sale_price
I've looked everywhere that I can in the admin page, and I've done plenty of google searching, with my (admittedly limited) google-fu. I've been able to turn up plenty of for-pay extensions that'll export a Google Shopping RSS feed, or other RSS feeds, that can be customized to this extent, I believe, but I'm not going to be able to sell my clients on a non-free extension to get this working.
Does anybody know if there is a way that I can add these fields to the RSS feeds, via the admin control page? If not, can anybody direct me to the appropriate locations, in code, where I might be able to code these additions myself? As always, any helpful tidbits, or even pointers in vaguely correct directions, are greatly appreciated.
Thanks in advance. Please feel free to let me know, if I've left out any information that is necessary for figuring this out.
-Damon
Best Answer
The blocks used in Rss creation are in
app/code/core/Mage/Rss/Block
Just a guess, but maybe you want to modify the
app/code/core/Mage/Rss/Block/Catalog/Category.php
file? There are several, take a look at the blocks and see which affects the feed you are concerned with.I would create a simple module that rewrites the block you need to modify. A quick example, assuming that your company is called Yourcompany :
app/code/local/Yourcompany/Rss/etc/config.xml
app/code/local/Yourcompany/Rss/Block/Rss/Catalog/Category.php
class Yourcompany_Rss_Block_Rss_Catalog_Category extends Mage_Rss_Block_Catalog_Category {
}
In this case, if you modify the collection at ~ line 47
to include the attributes you need you should have them in the feed.
You will also need your module declared in app/etc/modules, but your question was about rss, not custom modules ; )
So, take a look at the contents of
app/code/core/Mage/Rss/Block/
, and rewrite the file that corresponds to your feed.** I used a module name of Rss, that was totally arbitrary, you can name the module anything you want.