Advertisement:

Author Topic: oc-includes - RSSFeed.php - How to make it output item price?  (Read 258 times)

Resta

  • Sr. Member
  • ****
  • Posts: 345
oc-includes - RSSFeed.php - How to make it output item price?
« on: January 29, 2019, 07:14:51 am »
Hello,

In oc-includes/osclass/classes/RSSFeed.php which outputs the rss feed in xml format, but it does not output some things like item id, item price(important), seller name, seller email, etc.,

How can I make it to output those additional parameters or at least just the item price?  I tried adding them in in the same format like other parameters but did not work., may be the data is obtained to rrsfeed.php from some other file that it calls?  Thanks!
« Last Edit: January 30, 2019, 03:54:09 am by Resta »

WEBmods

  • Hero Member
  • *****
  • Posts: 937
  • github.com/webmods-croatia/love-osclass/ | patrick
Re: oc-includes - RSSFeed.php - How to make it output item price?
« Reply #1 on: January 30, 2019, 08:48:34 pm »
Hello,

I see there are some hooks but let me just simplify it with core solution for now:

Open oc-includes/osclass/controller/search.php and go to line 586.
Add price to item array by changing this

Code: [Select]
                            $itemArray = array(
                                'title' => osc_item_title(),
                                'link' => htmlentities( osc_item_url() , ENT_COMPAT, "UTF-8"),
                                'description' => osc_item_description(),
                                'country' => osc_item_country(),
                                'region' => osc_item_region(),
                                'city' => osc_item_city(),
                                'city_area' => osc_item_city_area(),
                                'category' => osc_item_category(),
                                'dt_pub_date' => osc_item_pub_date()
                            );

to this

Code: [Select]
                            $itemArray = array(
                                'title' => osc_item_title(),
                                'link' => htmlentities( osc_item_url() , ENT_COMPAT, "UTF-8"),
                                'description' => osc_item_description(),
                                'country' => osc_item_country(),
                                'region' => osc_item_region(),
                                'city' => osc_item_city(),
                                'city_area' => osc_item_city_area(),
                                'category' => osc_item_category(),
                                'dt_pub_date' => osc_item_pub_date(),
                                'price' => osc_item_formated_price(),
                            );

Then in oc-includes/osclass/classes/RSSFeed.php use

Code: [Select]
echo '<price>', $item['price'], '</price>', PHP_EOL;
to output the price.

Regards.

Resta

  • Sr. Member
  • ****
  • Posts: 345
Re: oc-includes - RSSFeed.php - How to make it output item price?
« Reply #2 on: February 01, 2019, 12:19:11 pm »
 :D Thanks, Patrick!