Jump to content

XML Product feed


Recommended Posts

Hello PS users.

I have a problem with xml feed creation since i started to use PS 1.5.2 . On my old version PS 1.3.7 this php file works fine :

<?php

$shopUrl = 'http://www.your shop';

include(dirname(__FILE__).'/config/config.inc.php');

include(dirname(__FILE__).'/init.php');

error_reporting(0);

$p=Product::getProducts(5, 0, 0, 'id_product', 'desc', false);

$products=Product::getProductsProperties(5, $p);

header("Content-Type: text/xml");

echo '<?xml version="1.0" encoding="utf-8"?>

<SHOP>';

foreach ($products as $row) {

$img=Product::getCover($row['id_product']);

echo '

<SHOPITEM>

<SHOPID>'.$row['id_product'].'</SHOPID>

<ARTIKEL>'.str_replace("&", "&", $row['name']).'</ARTIKEL>

<ARTIKELNR.>'.$row['reference'].'</ARTIKELNR.>

<HERSTELLER>'.str_replace("&", "&", $row['manufacturer_name']).'</HERSTELLER>

<BESCHREIBUNG>'.str_replace("&", "&",strip_tags($row['description'])).'</BESCHREIBUNG>

<ARTIKELURL>'.$row['link'].'</ARTIKELURL>

<IMGURL>'.$shopUrl.'/img/p/'.$row['id_product'].'-'.$img['id_image'].'.jpg</IMGURL>

<PRICE_VAT>'.($row['price']*1).'</PRICE_VAT>

<LAGERSTAND>'.($row['quantity']*1).'</LAGERSTAND>

<EAN>'. round($row['ean13']) .'</EAN>

 

</SHOPITEM>';

}

echo '</SHOP>';

?>

 

Has anyone an idea, why it doesn´t work on the new PS1.5.2 ?

Or myabe has someone a working file?

Thank you for your help.

Link to comment
Share on other sites

  • 3 weeks later...
  • 4 weeks later...
×
×
  • Create New...