Jump to content

Categorie in rss.php feeder

Recommended Posts

Weet iemand hoe ik de categorie en evt de subcategorie in het bestand rss.php in de map modules/feeder kan krijgen?


Ik heb nu onderstaande:


header("Content-Type:text/xml; charset=utf-8");
echo '<?xml version="1.0" encoding="UTF-8"?>'."\n";
foreach ($products AS $product)
				    if ($product['active'] == 1){
						    $image = Image::getImages((int)($cookie->id_lang), $product['id_product']);
 echo "\t\t<product>\n";

						    // & in titel naar & omzetten
 echo "\t\t\t<Title>".str_replace("&", "&" , $product['name'])."</Title>\n";

 echo "\t\t\t<Beschrijving>".str_replace("&", "&" , $product['description'])."</Beschrijving>\n";

 echo "\t\t\t<Prijs>".html_entity_decode(Tools::displayPrice(Product::getPriceStatic($product['id_product']), $currency), ENT_COMPAT, 'UTF-8')."</Prijs>\n";

 echo "\t\t\t<Image-locatie>";
 $cdata = true;
 if (is_array($image) AND sizeof($image))
  echo _PS_BASE_URL_.__PS_BASE_URI__."img/p/".$image[0]['id_product']."-".$image[0]['id_image']."-home.jpg";
  $cdata = false;
 echo "</Image-locatie>\n";

						    echo "\t\t\t<Portokosten>";

								    echo "0";

						    echo "</Portokosten>\n";

						    echo "\t\t\t<Levertijd>";
						   echo "1-2 werkdagen";

						    echo "</Levertijd>\n";

						    echo "\t\t\t<Winkelproductcode>";
						    echo $product['id_product'];
						    echo "</Winkelproductcode>\n";
 echo "\t\t\t<Deeplink>".htmlspecialchars($link->getproductLink($product['id_product'], $product['link_rewrite'], Category::getLinkRewrite((int)($product['id_category_default']), $cookie->id_lang))).$affiliate."</Deeplink>\n";

						    echo "\t\t\t<Geslacht>";
						    echo "Dames";
						    echo "</Geslacht>\n";

						    echo "\t\t</product>\n";




Ik heb al verschillende dingen geprobeerd. In een ander topic zag ik dat iemand dit bijv. gebruikte:

 echo  "\t\t\t<Categorie>";
						    $cats = Product::getProductCategories($product['id_product']);
						    foreach ($cats AS $cat)
								    //home category niet tonen
								    if($cat != 1){
										    $catnames = Category::getSimpleCategories($cookie->id_lang);
										    foreach ($catnames as $catname){
												    if ($catname['id_category'] == $cat)
												    echo $catname['name'];
						    echo  "</Categorie>\n";


Maar dat werkte niet. Ik heb Prestashop 1.4

Share this post

Link to post
Share on other sites


Important Information

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