Jump to content

RSS Feed New Products


Recommended Posts

Hello Everyone,

I have a small problem the RSS Feed only displays the featured products from the home page, can anyone please help me modify the feeder module so that it only displays the new products?

Or at least can anyone please tell me if what i am reaching to achieve is possible or not?

Thank you,
Have a nice day,

Share this post


Link to post
Share on other sites

  • 4 weeks later...

It pretty straight forward even in French!:-)
Replace your current module with the one in the post.
If you look at the last post on the thread from Just Ben you will see that he show's you what to replace in the file rss.php for your feed to display all products.
Works fine for me.

Share this post


Link to post
Share on other sites

yes there are some values you have to change in the rss.php to show more than 10.
I am showing 15 products by changing the BOLD text below:

// Get data
$number = (intval(Tools::getValue('n')) ? intval(Tools::getValue('n')) : 15);
$orderByValues = array(0 => 'name', 1 => 'price', 2 => 'date_add', 3 => 'date_upd', 4 => 'position');
$orderWayValues = array(0 => 'ASC', 1 => 'DESC');
$orderBy = Tools::strtolower(Tools::getValue('orderby', $orderByValues[intval(Configuration::get('PS_PRODUCTS_ORDER_BY'))]));
$orderWay = Tools::strtoupper(Tools::getValue('orderway', $orderWayValues[intval(Configuration::get('PS_PRODUCTS_ORDER_WAY'))]));
if (!in_array($orderBy, $orderByValues))
$orderBy = $orderByValues[0];
if (!in_array($orderWay, $orderWayValues))
$orderWay = $orderWayValues[0];
$id_category = (intval(Tools::getValue('id_category')) ? intval(Tools::getValue('id_category')) : 1);
$products = Product::getProducts(intval($cookie->id_lang), 0, ($number > 15 ? 15 : $number), 'date_add', $orderWay, false, false);
$currency = new Currency(intval($cookie->id_currency));
$affiliate = (Tools::getValue('ac') ? '?ac='.Tools::getValue('ac') : '');
$datepub = date(DATE_RSS);

Share this post


Link to post
Share on other sites

Just an example..Chose 15 as a random number:-)
Good to hear its working for you.
Your URL's for feeds can be either http://yourdomain/rss.xml'>http://yourdomain/rss.xml OR http://yourdomain/modules/feeder/rss.php
If you use GoogleBase to submit your shop items you can try submitting the URL http://yourdomain/rss.xm and see if they accept the format. Base can be fussy sometimes.

Share this post


Link to post
Share on other sites

  • 4 months later...

Hi Guys,

First, thanks to iondarie for making a lightbulb go off, I was always wondering why my feed showed just 6 products, and it turns out it only shows the 6 I have featured on the home page, feel quite stupid for not picking up on that.

Now my question, I would like to use this feed as a product feed that I can submit to Shopping Comparison sites so they can display my products automatically, for instance with getprice.com.au an myshopping.com.au


How would I go about implementing a feed that displays all my products, from newest to oldest, so I can submit it to relevant sites for advertising???

Am I correct to assume, that if I use thethreedegrees method of displaying an X number of items in the feed, then the other sites will only pick up the newest additions and not the older stuff???

Any info is greatly appreciated!

Share this post


Link to post
Share on other sites

Hi
by default is the featured products that come up on the rss feed so you need to change:

On the feeder.php on line 32 change the
$id_category = 11; ( thsi 11 is my category , you can see the cat you want on the backoffice click it and in the browser chek the id

and then on the rss.php

starnting on line 20

$number = (intval(Tools::getValue('n')) ? intval(Tools::getValue('n')) : 100);
$orderByValues = array(0 => 'name', 1 => 'price', 2 => 'date_add', 3 => 'date_upd', 4 => 'position');
$orderWayValues = array(0 => 'ASC', 1 => 'DESC');
$orderBy = Tools::strtolower(Tools::getValue('orderby', $orderByValues[intval(Configuration::get('PS_PRODUCTS_ORDER_BY'))]));
$orderWay = Tools::strtoupper(Tools::getValue('orderway', $orderWayValues[intval(Configuration::get('PS_PRODUCTS_ORDER_WAY'))]));
if (!in_array($orderBy, $orderByValues))
$orderBy = $orderByValues[0];
if (!in_array($orderWay, $orderWayValues))
$orderWay = $orderWayValues[0];
$id_category = (intval(Tools::getValue('id_category')) ? intval(Tools::getValue('id_category')) : 1);
$products = Product::getProducts(intval($cookie->id_lang), 0, ($number > 100 ? 100 : $number), 'date_add', $orderWay, false, false);

hope it helped

Share this post


Link to post
Share on other sites

 Share

×
×
  • Create New...

Important Information

Cookies ensure the smooth running of our services. Using these, you accept the use of cookies. Learn More