News:

You may pay someone to create your store, or you visit our seminar and become a professional yourself with the silver certification

Main Menu

RSS Feed for categories are Missing in VM 2

Started by elda, October 15, 2012, 21:04:14 PM

Previous topic - Next topic

elda

Hi,

I have migrated the website from VM 1.x to VM 2.0. After migrating i see that the option for adding RSS feed for the categories is missing. Please advise me to add RSS feed for the categories.

- Elda Williams

MickeyBlueEyes

#1
LOL you gotta switch back or shovel off 50$ for the RSS mod, which is btw bad cause it creates static feed. I'm in the same shoes and i regret the upgrade big time.


Shorten URLs linke.rs

elda

Hi,

I have found a solution for my problem I have custom programmed the RSS feed for each category.

SELECT vm.file_url,z.virtuemart_media_id,h.product_name , h.product_desc, h.virtuemart_product_id
FROM j25_virtuemart_products_en_gb as h, j25_virtuemart_product_medias as z, j25_virtuemart_medias  as vm
WHERE  z.ordering = 1 and h.`virtuemart_product_id` = z.`virtuemart_product_id` and h.`virtuemart_product_id`
IN (SELECT l.`virtuemart_product_id`
  FROM `j25_virtuemart_products_en_gb` as l JOIN `j25_virtuemart_products` AS p using (`virtuemart_product_id`)
  LEFT JOIN `j25_virtuemart_product_categories`
  ON p.`virtuemart_product_id` = `j25_virtuemart_product_categories`.`virtuemart_product_id`
  LEFT JOIN `j25_virtuemart_categories_en_gb` as c
  ON c.`virtuemart_category_id` = `j25_virtuemart_product_categories`.`virtuemart_category_id`
  LEFT JOIN `j25_virtuemart_product_shoppergroups`
  ON p.`virtuemart_product_id` = `j25_virtuemart_product_shoppergroups`.`virtuemart_product_id`
  LEFT
  OUTER JOIN `j25_virtuemart_shoppergroups` as s
  ON s.`virtuemart_shoppergroup_id` = `j25_virtuemart_product_shoppergroups`.`virtuemart_shoppergroup_id`
  WHERE ( p.`published`='1'
  AND `j25_virtuemart_product_categories`.`virtuemart_category_id` = ".$catid."
  AND `j25_virtuemart_product_categories`.`virtuemart_category_id` > 0
  AND ( s.`virtuemart_shoppergroup_id`= '.$groupid.' OR s.`virtuemart_shoppergroup_id` IS NULL ) )
  group by p.`virtuemart_product_id`
  ORDER BY product_name ASC)  and vm.virtuemart_media_id = z.virtuemart_media_id


- Change the $catid and group id with what value you need and create an xml file.

Sample xml file


<?php 
header('Content-Type: text/xml'); 
require_once ('database_connection_file.php');
echo '<?xml version="1.0" encoding="ISO-8859-1"?> 
<rss version="2.0"> 
<channel> 
<title>Sample RSS feed for Products</title> 
<description>A description of the feed</description> 
<link>The URL to the website</link>'; 
$get_articles = "SELECT vm.file_url,z.virtuemart_media_id,h.product_name , h.product_desc, h.virtuemart_product_id
FROM j25_virtuemart_products_en_gb as h, j25_virtuemart_product_medias as z, j25_virtuemart_medias  as vm
WHERE  z.ordering = 1 and h.`virtuemart_product_id` = z.`virtuemart_product_id` and h.`virtuemart_product_id`
IN (SELECT l.`virtuemart_product_id`
  FROM `j25_virtuemart_products_en_gb` as l JOIN `j25_virtuemart_products` AS p using (`virtuemart_product_id`)
  LEFT JOIN `j25_virtuemart_product_categories`
  ON p.`virtuemart_product_id` = `j25_virtuemart_product_categories`.`virtuemart_product_id`
  LEFT JOIN `j25_virtuemart_categories_en_gb` as c
  ON c.`virtuemart_category_id` = `j25_virtuemart_product_categories`.`virtuemart_category_id`
  LEFT JOIN `j25_virtuemart_product_shoppergroups`
  ON p.`virtuemart_product_id` = `j25_virtuemart_product_shoppergroups`.`virtuemart_product_id`
  LEFT
  OUTER JOIN `j25_virtuemart_shoppergroups` as s
  ON s.`virtuemart_shoppergroup_id` = `j25_virtuemart_product_shoppergroups`.`virtuemart_shoppergroup_id`
  WHERE ( p.`published`='1'
  AND `j25_virtuemart_product_categories`.`virtuemart_category_id` = ".$_GET['feed_id']."
  AND `j25_virtuemart_product_categories`.`virtuemart_category_id` > 0
  AND ( s.`virtuemart_shoppergroup_id`= '12' OR s.`virtuemart_shoppergroup_id` IS NULL ) )
  group by p.`virtuemart_product_id`
  ORDER BY product_name ASC)  and vm.virtuemart_media_id = z.virtuemart_media_id"; 
// echo $get_articles
$articles = mysql_query($get_articles) or die(mysql_error()); 
 
while ($article = mysql_fetch_array($articles)){ 

$ro = preg_replace('/\s\s+/', ' ',strip_tags($article['product_desc']));
echo $article['file_url'];
echo ' 
   <item><title><![CDATA['.$article['product_name'].']]></title><link><![CDATA[http://www.example.com/index.php?option=com_virtuemart&view=productdetails&virtuemart_category_id=37&virtuemart_manufacturer_id=3&virtuemart_product_id='.$article['virtuemart_product_id'].'&Itemid=193]]></link><description><![CDATA[<img src="http://www.example.com/'.$article['file_url'].'"/>]]></description></item>'; 
   } 
echo '</channel> 
</rss>'; 
?> 

Please let me know if you need any assistance.

- Elda Williams

coppo82

hi , can you explain me better what i should do for display a rss feed of my products ???

thanks a lot
the best solution for the joomla virtuemart CSV
http://joomdonation.com/components/csv-advanced.html