Stofferdreng Posted April 28, 2014 Share Posted April 28, 2014 I have installed the products and I thought it would give me a RSS feed with the 10 newest products It does not show the newest products - just 10 products from the catalogue http://www.gadgethuset.dk/modules/feeder/rss.php Anyone know how to fix ? Link to comment Share on other sites More sharing options...
vekia Posted April 28, 2014 Share Posted April 28, 2014 feeder is based on default order by value. open rss.php file and change $products = Product::getProducts((int)Context::getContext()->language->id, 0, ($number > 10 ? 10 : $number), $orderBy, $orderWay, $id_category, true); to: $products = Product::getProducts((int)Context::getContext()->language->id, 0, ($number > 10 ? 10 : $number), "id_product", "desc", $id_category, true); 4 1 Link to comment Share on other sites More sharing options...
Stofferdreng Posted April 28, 2014 Author Share Posted April 28, 2014 As always Vekia - You are the BEST, thanks /Christopher Link to comment Share on other sites More sharing options...
Andr3Ace Posted May 9, 2014 Share Posted May 9, 2014 (edited) feeder is based on default order by value. open rss.php file and change $products = Product::getProducts((int)Context::getContext()->language->id, 0, ($number > 10 ? 10 : $number), $orderBy, $orderWay, $id_category, true); to: $products = Product::getProducts((int)Context::getContext()->language->id, 0, ($number > 10 ? 10 : $number), "id_product", "desc", $id_category, true); hi vekia, but in my case it's the same result with the original code. it only shows the featured product. same with if i add the url manually with .../modules/feeder/rss.php?n=10&orderway=0&orderby=date_add. i have already followed other topics with the same case since 2010 . but nothing works they always go to featured products catalogue. is it possible to make the rss feed go the new products area? thanks in advance **UPDATE** Solution came from the past for me http://www.prestashop.com/forums/topic/57484-rss-feed-to-show-new-products/page-2?do=findComment&comment=604139 funny, i read this post before & didn't work. now work like a charm Edited May 9, 2014 by Andr3Ace (see edit history) Link to comment Share on other sites More sharing options...
filipstudio Posted May 27, 2014 Share Posted May 27, 2014 Hello, I tried this fix too, but nothing seems to change. My situation is slightly different: there's only a site description, a blank icon (with a question mark) and there are no products whatsoever. I've never had this problem with 1.5 and can't understand what is misconfigured. http://filipstudio.com/modules/feeder/rss.php I've reinstalled the module, turned off the cache, but nothing worked. Is there a way to fix this? Thank you. Link to comment Share on other sites More sharing options...
Funny-Cat WebShop Posted July 10, 2014 Share Posted July 10, 2014 feeder is based on default order by value. open rss.php file and change $products = Product::getProducts((int)Context::getContext()->language->id, 0, ($number > 10 ? 10 : $number), $orderBy, $orderWay, $id_category, true); to: $products = Product::getProducts((int)Context::getContext()->language->id, 0, ($number > 10 ? 10 : $number), "id_product", "desc", $id_category, true); Worked perfectly. Thank you. Link to comment Share on other sites More sharing options...
hatak Posted August 29, 2014 Share Posted August 29, 2014 this is the code of rss.php (ps 1.6.06) with new products of shop and i've changed also it to 25 products displayed and medium size pictures: <?php /* * 2007-2014 PrestaShop * * NOTICE OF LICENSE * * This source file is subject to the Academic Free License (AFL 3.0) * that is bundled with this package in the file LICENSE.txt. * It is also available through the world-wide-web at this URL: * http://opensource.org/licenses/afl-3.0.php * If you did not receive a copy of the license and are unable to * obtain it through the world-wide-web, please send an email * to [email protected] so we can send you a copy immediately. * * DISCLAIMER * * Do not edit or add to this file if you wish to upgrade PrestaShop to newer * versions in the future. If you wish to customize PrestaShop for your * needs please refer to http://www.prestashop.com for more information. * * @author PrestaShop SA <[email protected]> * @copyright 2007-2014 PrestaShop SA * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) * International Registered Trademark & Property of PrestaShop SA */ include(dirname(__FILE__).'/../../config/config.inc.php'); require_once(dirname(__FILE__).'/../../init.php'); if (!Module::getInstanceByName('feeder')->active) exit; // Get data $number = ((int)(Tools::getValue('n')) ? (int)(Tools::getValue('n')) : 10); $orderByValues = array(0 => 'date_add', 1 => 'price', 2 => 'name', 3 => 'date_upd', 4 => 'position'); $orderWayValues = array(0 => 'DESC', 1 => 'ASC'); $id_category = ((int)(Tools::getValue('id_category')) ? (int)(Tools::getValue('id_category')) : Configuration::get('PS_HOME_CATEGORY')); $products = Product::getNewProducts((int)Context::getContext()->language->id, 0, 25, false, 'date_add', 'DESC'); $currency = new Currency((int)Context::getContext()->currency->id); $affiliate = (Tools::getValue('ac') ? '?ac='.(int)(Tools::getValue('ac')) : ''); $metas = Meta::getMetaByPage('index', (int)Context::getContext()->language->id); // Send feed header("Content-Type:text/xml; charset=utf-8"); echo '<?xml version="1.0" encoding="UTF-8"?>'."\n"; ?> <rss version="2.0"> <channel> <title><![CDATA[<?php echo Configuration::get('PS_SHOP_NAME') ?>]]></title> <description><![CDATA[<?php echo $metas['description'] ?>]]></description> <link><?php echo _PS_BASE_URL_.__PS_BASE_URI__; ?></link> <webMaster><?php echo Configuration::get('PS_SHOP_EMAIL') ?></webMaster> <generator>PrestaShop</generator> <language><?php echo Context::getContext()->language->iso_code; ?></language> <image> <title><![CDATA[<?php echo Configuration::get('PS_SHOP_NAME') ?>]]></title> <url><?php echo _PS_BASE_URL_.__PS_BASE_URI__.'img/logo.jpg'; ?></url> <link><?php echo _PS_BASE_URL_.__PS_BASE_URI__; ?></link> </image> <?php foreach ($products AS $product) { $image = Image::getImages((int)($cookie->id_lang), $product['id_product']); echo "\t\t<item>\n"; echo "\t\t\t<pubDate><![CDATA[".$product['date_add']." ]]></pubDate>\n"; echo "\t\t\t<title><![CDATA[".$product['name']." - ".html_entity_decode(Tools::displayPrice(Product::getPriceStatic($product['id_product']), $currency), ENT_COMPAT, 'UTF-8')." ]]></title>\n"; echo "\t\t\t<description>"; $cdata = true; if (is_array($image) AND sizeof($image)) { $imageObj = new Image($image[0]['id_image']); echo "<![CDATA[<img src='".$link->getImageLink($product['link_rewrite'], $image[0]['id_image'], 'medium_default')."' title='".str_replace('&', '', $product['name'])."' alt='thumb' />"; $cdata = false; } if ($cdata) echo "<![CDATA["; echo $product['description_short']."]]></description>\n"; echo "\t\t\t<link><![CDATA[".str_replace('&', '&', htmlspecialchars($link->getproductLink($product['id_product'], $product['link_rewrite'], Category::getLinkRewrite((int)($product['id_category_default']), $cookie->id_lang)))).$affiliate."]]></link>\n"; echo "\t\t</item>\n"; } ?> </channel> </rss> 4 Link to comment Share on other sites More sharing options...
jonysi_d Posted November 18, 2014 Share Posted November 18, 2014 (edited) Perfect with 1.6.0.9 thanks Edited November 18, 2014 by jonysi_d (see edit history) Link to comment Share on other sites More sharing options...
selectshop.at Posted December 2, 2014 Share Posted December 2, 2014 +1 perfect with PS 1.6.0.9 Link to comment Share on other sites More sharing options...
cliqadam Posted December 18, 2014 Share Posted December 18, 2014 this is great but one more variation request. Is there a way to randomize the items instead of sorting them. I want to use the RSS feed on multiple external pages showing random products can anything be done with rand() or shuffle() on rss.php file? Link to comment Share on other sites More sharing options...
Recommended Posts