Home > Magento Tutorials > Remove Price From RSS XML

Remove Price From RSS XML

Posted on: 22nd Apr 2010 By: Adam Moss No Comments

The need came up recently to remove the prices from the RSS XML file produced by Magento, which shows the products inside a category. The company did not want its prices advertised on the website, instead the items are displayed alongside an ‘Enquire Online’ button which pre-fills the contact form with the product information. Therefore the prices do not want to be shown in the RSS feed, so in order to remove them from the code you need to once again plummet into the murky depths of Magento’s core PHP. The journey begins at the following:

app > code > core > Mage > Rss > Block > Catalog > Category.php

Comment out the following code:

'<p> Price:'.Mage::helper('core')->currency($_product->getPrice()).
($_product->getPrice() != $final_priceĀ  ? ' Special Price:'. Mage::helper('core')->currency($final_price) : '').
'</p>'.

app > code > core > Mage > Rss > Block > Catalog > New.php

Comment out the following code:

'<p> Price:'.Mage::helper('core')->currency($product->getPrice()).
($product->getPrice() != $final_priceĀ  ? ' Special Price:'. Mage::helper('core')->currency($final_price) : '').
'</p>'.

At this point you’ll almost certainly need to refresh the cache to see the changes, then the price will be removed.

Post A Comment

Your comments:
Enclose code snippets within the appropriate tags: [php][/php]   [js][/js]   [xml][/xml]   [css][/css]   [html][/html]
E.g: [php]<?php echo "hello world"; ?>[/php]

Search Blog

Archives

For the record...

Views & opinions in this blog are those of the individual and do not necessarily reflect those of E-commerce Web Design or the Creare Group.