nostradamus 29 Posted April 28, 2012 (edited) How to post new products on your facebook wall tutorial This is working for PrestaShop v1.4.7 First we will change the rrs to show new products Open modules/feeder/rrs.php Find $orderBy = Tools::getProductsOrder('by', Tools::getValue('orderby')); $orderWay = Tools::getProductsOrder('way', Tools::getValue('orderway')); Replace with $orderByValues = array(0 => 'date_add', 1 => 'price', 2 => 'name', 3 => 'date_upd', 4 => 'position'); $orderWayValues = array(0 => 'DESC', 1 => 'ASC'); Find $products = Product::getProducts(intval($cookie->id_lang), 0, ($number > 10 ? 10 : $number), $orderBy, $orderWay, $id_category, true); Replace with $products = Product::getNewProducts(intval($cookie->id_lang), 0, 10, false, 'date_add', 'DESC'); Now we need to add the pubdate for the product to the rss Find $image = Image::getImages((int)($cookie->id_lang), $product['id_product']); echo "\t\t<item>\n"; Add after on a new line echo "\t\t\t<pubDate><![CDATA[".$product['date_add']." ]]></pubDate>\n"; If you want to use a bigger image for your facebook post Find echo "<![CDATA[<img src='"._PS_BASE_URL_._THEME_PROD_DIR_.$imageObj->getExistingImgPath()."-small.jpg' title='".str_replace('&', '', $product['name'])."' alt='thumb' />"; Replace with echo "<![CDATA[<img src='"._PS_BASE_URL_._THEME_PROD_DIR_.$imageObj->getExistingImgPath()."-medium.jpg' title='".str_replace('&', '', $product['name'])."' alt='thumb' />"; Open modules/feeder/feeder.php Find 'feedUrl' => 'http://'.htmlspecialchars($_SERVER['HTTP_HOST'], ENT_COMPAT, 'UTF-8').__PS_BASE_URI__.'modules/'.$this->name.'/rss.php?id_category='.$id_category.'&orderby='.$orderBy.'&orderway='.$orderWay, Replace with 'feedUrl' => 'http://'.htmlspecialchars($_SERVER['HTTP_HOST'], ENT_COMPAT, 'UTF-8').__PS_BASE_URI__.'modules/'.$this->name.'/rss.php')); Your done making changes to files. Save and upload the files to your server Now got to modules and install RSS products feed Now go to http://www.rssgraffiti.com/ And follow these steps to a make a basic setup tailored to your specifications http://www.rssgraffi...e_id=2081364848 The RSS url you need is www.your-site.com/modules/feeder/rss.php When your done with the setup RRS Graffiti will post your new products on your facebook wall Demo RSS Feed http://www.bijouxenz.../feeder/rss.php Facebook page http://www.facebook....114295085294829 Dont forget to like the Facebook page UPDATE i added the modified files as a download Extract the zip file and upload it to the modules folder feeder.zip Edited May 21, 2012 by nostradamus (see edit history) 8 Share this post Link to post Share on other sites
verhoej 5 Posted April 29, 2012 Hi, Im having a few problems. I have in BO 2 modules RSS Feed and RSS product feed, do i need to install 1 of them ? How do i configure it. because when im in RSS Graffitit in add source "www.byxanthe.com/modules/feeder/rss.php" type it gives me an error Error: This Feed URL does not seem to be valid. Share this post Link to post Share on other sites
nostradamus 29 Posted April 29, 2012 Hi, Im having a few problems. I have in BO 2 modules RSS Feed and RSS product feed, do i need to install 1 of them ? How do i configure it. because when im in RSS Graffitit in add source "www.byxanthe.com/modules/feeder/rss.php" type it gives me an error Error: This Feed URL does not seem to be valid. Sorry i forgot the module! You need to install RSS products feed to make it work. Share this post Link to post Share on other sites
verhoej 5 Posted April 29, 2012 furthermore this line aint in my rss.php $orderByValues = array(0 => 'name', 1 => 'price', 2 => 'date_add', 3 => 'date_upd', 4 => 'position'); $orderWayValues = array(0 => 'ASC', 1 => 'DESC'); should i just add it?? Share this post Link to post Share on other sites
nostradamus 29 Posted April 29, 2012 furthermore this line aint in my rss.php $orderByValues = array(0 => 'name', 1 => 'price', 2 => 'date_add', 3 => 'date_upd', 4 => 'position'); $orderWayValues = array(0 => 'ASC', 1 => 'DESC'); should i just add it?? Again my bad the find line was wrong. I changed it and i will add the modified feeder module to the first post as a download. Share this post Link to post Share on other sites
verhoej 5 Posted April 29, 2012 ty, installed all. When i click on configure in the rss product feed module it says this: Url for example: http://www.byxanthe....hp?id_category={id_category}&orderby=position&orderway=asc Replace {id_category} by the id category current or "0" Is this correct ? Because there are no products uploaded to FB Share this post Link to post Share on other sites
nostradamus 29 Posted April 29, 2012 thats the default rss url provided by prestashop you can ignore it use http://www.your-site.com/modules/feeder/rss.php Share this post Link to post Share on other sites
verhoej 5 Posted April 29, 2012 Figured it out now. Works like a charm.. tnx Share this post Link to post Share on other sites
azzchemoto 0 Posted April 29, 2012 I have te 1.4.5.1 can i follow your instruction? THANKS Share this post Link to post Share on other sites
nostradamus 29 Posted April 30, 2012 I have te 1.4.5.1 can i follow your instruction? THANKS you can give it a try make sure you make a backup of the feeder module Share this post Link to post Share on other sites
azzchemoto 0 Posted April 30, 2012 you can give it a try make sure you make a backup of the feeder module Ok i have tryed don't funct. I have modify files but the site was blocked, so i come back on my step. Share this post Link to post Share on other sites
gilmararcanjo 0 Posted May 5, 2012 (edited) Super this rss bro. Thanks Edited May 5, 2012 by gilmararcanjo (see edit history) Share this post Link to post Share on other sites
HelenI 1 Posted May 14, 2012 I tried this and get an error: There are currently 10 posts within the feed missing a date entry (required) and were not published. Probably i messed something UP in RSS file, but I do not know where to look. I have prestashop 1.3.2 Share this post Link to post Share on other sites
nostradamus 29 Posted May 14, 2012 I tried this and get an error: There are currently 10 posts within the feed missing a date entry (required) and were not published. Probably i messed something UP in RSS file, but I do not know where to look. I have prestashop 1.3.2 this is for 1.4+ only sorry Share this post Link to post Share on other sites
pubguv 7 Posted May 15, 2012 Working great, thank you! Share this post Link to post Share on other sites
TeeCee 0 Posted May 21, 2012 There is en error in your coding. $products = Product::getNewProducts(intval($cookie->id_lang), 0, 10, false, 'date_add', 'DESC' should be $products = Product::getNewProducts(intval($cookie->id_lang), 0, 10, false, 'date_add', 'DESC'); Share this post Link to post Share on other sites
nostradamus 29 Posted May 21, 2012 There is en error in your coding. $products = Product::getNewProducts(intval($cookie->id_lang), 0, 10, false, 'date_add', 'DESC' should be $products =Product::getNewProducts(intval($cookie->id_lang),0,10,false,'date_add','DESC'); Thanks lost a bit in copy and past lol i fixed the first post Share this post Link to post Share on other sites
miscomasa 1 Posted June 7, 2012 I think it's a great idea, but. How to put too the news of the free blog (Prestalive) in the rss? with that it's will be perfect Regards http://www.donoferton.com Share this post Link to post Share on other sites
verato 0 Posted June 28, 2012 Thank you friend. Just what I needed. Share this post Link to post Share on other sites
PrestaExt 12 Posted July 9, 2012 (edited) hello you can view http://prestaext.com/extensions/modules-showcase/item/46-pe-auto-facebook Edited August 10, 2012 by tungkoy (see edit history) Share this post Link to post Share on other sites
Aloud 1 Posted August 30, 2012 Brilliant tutorial, works perfect! Share this post Link to post Share on other sites
outlet.ee 9 Posted September 1, 2012 I have 4 languages in my shop, will it be the default language in the FB posts then? I guess I need to change the default language if I want to post in another lang, right? Share this post Link to post Share on other sites
PEPPE83 8 Posted October 6, 2012 Hi, you know a way to add the long description in the RSS Feed? Share this post Link to post Share on other sites
mmsh 10 Posted October 9, 2012 hi... $count = mt_rand(2,1133) ; $id_category = ((int)(Tools::getValue('id_category')) ? (int)(Tools::getValue('id_category')) : $count); $products = Product::getProducts((int)($cookie->id_lang), 0, 30, 'id_product', 'DESC', $id_category, true); well... i have many categories and let the script choose random... but my problem is to skip empty categories...without products... how to do it? thanks Share this post Link to post Share on other sites
rusteh 9 Posted October 30, 2012 Hey, Worked on 1.4.8.2, trying to have it on 1.5.2 but it just open the save as for rss.php. Did someone managed to make it work? Thanks Share this post Link to post Share on other sites
PEPPE83 8 Posted December 31, 2012 Now RSS Graffiti accept only RSS with W3C compatibility.....and Prestashop dont have RSS W3C compatible, anyone have a solution? Share this post Link to post Share on other sites
Abangon 0 Posted January 1, 2013 I made all, that you have in tutorial, it saved without problems, but no feeds on facebook, when i want to see live preview RSS Grafiity said "There is currently no data for this feed." what can it be ? Share this post Link to post Share on other sites
PEPPE83 8 Posted January 2, 2013 Now RSS Graffiti accept only W3C RSS certified and PS RSS is not compatible... Share this post Link to post Share on other sites
todaytonight 9 Posted January 24, 2013 Thanks for sharing but it doesn't work with PS 1.4.8 Share this post Link to post Share on other sites
Aloys 2 Posted February 2, 2013 (edited) any update on the W3C RSS? Edited February 2, 2013 by Aloys (see edit history) Share this post Link to post Share on other sites
parpro8 1 Posted February 28, 2013 Mine work nicely with 1.5.3 Tnx Share this post Link to post Share on other sites
parpro8 1 Posted March 8, 2013 thos trick work nine but in my fb page product link Show http://www.o9bazar.com/index.php?id_product=35&%3Bcontroller=product But The Actutal link is http://www.o9bazar.com/index.php?id_product=35&controller=product How to currect this plese help me Share this post Link to post Share on other sites
Trip 81 Posted May 11, 2013 rss.php Hi there, I modified the rss.php and now it seems to be accepted and goes through W3C validation. This is working in PS 1.5.4.1. You might want to toggle the following $products = Product::getNewProducts(1, 0, 30); 1 is the language id, zero should not be changed and 30 is the number of products. To get it validated I added <description>My Desciption</description> changed pubDate to echo "\t\t\t<pubDate><![CDATA[".date("r",strtotime($product['date_add']))."]]></pubDate>\n"; addad guid echo "\t\t\t<guid><![CDATA[".str_replace('&', '&', htmlspecialchars($link->getproductLink($product['id_product'], $product['link_rewrite'], Category::getLinkRewrite((int)($product['id_category_default']), $cookie->id_lang)))).$affiliate."]]></guid>\n"; and to maybe get bigger previews I change echo "<![CDATA[<img src='"._PS_BASE_URL_._THEME_PROD_DIR_.$imageObj->getExistingImgPath()."-thickbox_default.jpg' title='".str_replace('&', '', $product['name'])."' alt='thumb' />"; to thickbox. Best regards, trip 3 Share this post Link to post Share on other sites
newcommer 15 Posted June 23, 2013 RSS Graffiti dosent work for me i get this error We were unable to find any publishable items in this feed. The feed may be empty, or the items in the feed may be missing critical elements (such as links or pubdates) which prevent us from publishing. But the feed is ok Share this post Link to post Share on other sites
Generaal 11 Posted June 24, 2013 Nice setting PS guy's, I have download the files and wil go for it, when I have finished with my preview work to fix my shop to clean working. Thanks for sharing this, Generaal Share this post Link to post Share on other sites
outlet.ee 9 Posted July 29, 2013 I got it working on 1.5.2, after following Trip's advice on post #34. I decided to create a separate FB page for each of the 4 languages in my shop. And I created separate product feeds for each, too. Now for the Swedish language I need to force the currency to be SEK. If I change line 36 in rss.php: from $currency = new Currency((int)Context::getContext()->currency->id); to $currency = new Currency(3); it changes the currency symbol but doesn't convert the amount itself. How would I make it to force the prices in SEK? Share this post Link to post Share on other sites
scenteddelights 1 Posted August 29, 2013 Hi All, ok i got to rss.php file and i don't have the first file that i am suppose to look for at the start of this tutorial...$orderBy = Tools::getProductsOrder('by', Tools::getValue('orderby')); could someone lend me hand on what to do please....i'd like to have my new products show up on my facebook page. thanks for the help. shop version 1.5.3 Share this post Link to post Share on other sites
scenteddelights 1 Posted August 30, 2013 Can noone help out on how to do this....or is there another way to get your products to post to facebook once you implement them to your site? Share this post Link to post Share on other sites
jonysi_d 14 Posted October 22, 2013 (edited) It's solved for me ..!! perfect,!!!! Edited October 22, 2013 by jonysi_d (see edit history) Share this post Link to post Share on other sites
jonysi_d 14 Posted October 23, 2013 I just saw that is published in English descriptions, etc ... as I do to come out in Spanish?? Share this post Link to post Share on other sites
fuskoz 0 Posted October 23, 2013 hello everyone!I was able to make it work and the power of this is huge. Thank you for making it possible. I was wondering why I only get the link of the products to be displayed on facebook and there is no product picture. Sorry for my bad English. Am I the only one experiencing this? On the posts in my Facebook page I see only the product description with no product picture. Anyone know what's happening? Thank you !!! Share this post Link to post Share on other sites
jonysi_d 14 Posted October 29, 2013 I can't change the language description.Look the <language> es</language> but the descriptions are in english my rss linck someone know why ??? Share this post Link to post Share on other sites
dano 1 Posted December 11, 2013 Hello ! This my code for rss.php on PS 1.5.6.2 : <?php /* * 2007-2013 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 license@prestashop.com 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 <contact@prestashop.com> * @copyright 2007-2013 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'); // Get data $number = ((int)(Tools::getValue('n')) ? (int)(Tools::getValue('n')) : 10); $orderBy = Tools::getProductsOrder('by', Tools::getValue('orderby')); $orderWay = Tools::getProductsOrder('way', Tools::getValue('orderway')); $id_category = ((int)(Tools::getValue('id_category')) ? (int)(Tools::getValue('id_category')) : Configuration::get('PS_HOME_CATEGORY')); $products = Product::getNewProducts(1, 0, 30); $currency = new Currency((int)Context::getContext()->currency->id); $affiliate = (Tools::getValue('ac') ? '?ac='.(int)(Tools::getValue('ac')) : ''); // Send feed header("Content-Type:text/xml; charset=utf-8"); echo '<?xml version="1.0" encoding="UTF-8"?>'."\n"; ?> <rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"> <channel> <title><![CDATA[<?php echo Configuration::get('PS_SHOP_NAME') ?>]]></title> <link><?php echo _PS_BASE_URL_.__PS_BASE_URI__; ?></link> <generator>PrestaShop</generator> <language><?php echo Context::getContext()->language->iso_code; ?></language> <description>My Desciption</description> <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> <atom:link href="<?php echo _PS_BASE_URL_.__PS_BASE_URI__.'modules/feeder/rss.php' ; ?>" rel="self" type="application/rss+xml" /> <?php foreach ($products AS $product) { $image = Image::getImages((int)($cookie->id_lang), $product['id_product']); echo "\t\t<item>\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<guid><![CDATA[".str_replace('&', '&', htmlspecialchars($link->getproductLink($product['id_product'], $product['link_rewrite'], Category::getLinkRewrite((int)($product['id_category_default']), $cookie->id_lang)))).$affiliate."]]></guid>\n"; echo "\t\t\t<pubDate><![CDATA[".date("r",strtotime($product['date_add']))."]]></pubDate>\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='"._PS_BASE_URL_._THEME_PROD_DIR_.$imageObj->getExistingImgPath()."-thickbox_default.jpg' 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> I tried it with RSS Graffiti and it works 1 Share this post Link to post Share on other sites
jonysi_d 14 Posted December 11, 2013 thanks... I copy and past your code but the languish remains the same..!! :-( Share this post Link to post Share on other sites
jonysi_d 14 Posted December 11, 2013 hi.. solved..!! thanks Share this post Link to post Share on other sites
dano 1 Posted December 27, 2013 What was your problem jonysi_d ? Share this post Link to post Share on other sites