I would like to ask on how to include the price in the RSS Feed Title in website running with Osclass.
Like This [Price / Title (Contact Number)]
public function dumpXML() {
echo '<?xml version="1.0" encoding="UTF-8"?>', PHP_EOL;
echo '<rss version="2.0">', PHP_EOL;
echo '<channel>', PHP_EOL;
echo '<title>', $this->title, '</title>', PHP_EOL;
echo '<link>', $this->link, '</link>', PHP_EOL;
echo '<description>', $this->description, '</description>', PHP_EOL;
foreach ($this->items as $item) {
echo '<item>', PHP_EOL;
echo '<title><![CDATA[', $item['title'], ']]></title>', PHP_EOL;
echo '<link>', $item['link'], '</link>', PHP_EOL;
echo '<guid>', $item['link'], '</guid>', PHP_EOL;
echo '<description><![CDATA[';
echo $item['description'], ']]>';
echo '</description>', PHP_EOL;
echo '<country>', $item['country'], '</country>', PHP_EOL;
echo '<region>', $item['region'], '</region>', PHP_EOL;
echo '<city>', $item['city'], '</city>', PHP_EOL;
echo '<cityArea>', $item['city_area'], '</cityArea>', PHP_EOL;
echo '<category>', $item['category'], '</category>', PHP_EOL;
echo '</item>', PHP_EOL;
}
echo '</channel>', PHP_EOL;
echo '</rss>', PHP_EOL;
}
}
Thanks You
Normally, I would tell you not to modify the core. You have a hook available designed for this purpose : 'feed' but it seems you can't access the data. So you'll have to modify the core.
Add a line
'price' => osc_item_formated_price()
to bothaddItem()
calls in oc-includes/controllers/search.php :Then you'll be able to modify the RSSfeed::dumpXML method by adding a
echo $item['price']
somewhere.PS: I'll try to make a commit in the Osclass Github to make the feed hook usable.