Jump to content

Xml Feed Málo Generuje


tomas

Recommended Posts

Mám tento funkční php script, ale vygeneruje mi pouze 259 produktů, hostuju u wedosu, verze presty 1.4.8.2, produktů v eshopu necelých 8tis, ví někdo jak upravit abych si mohl vygenerovat zvlášť kategorie? pak už bych si spojil všechny do jednoho. Myslím si že mi to vždy zabije timeout hostingu, může někdo popřípadě odzkoušet někde jinde??? díky

 

<?php
$shopUrl = 'http://www.xxx.cz';
include(dirname(__FILE__).'/config/config.inc.php');
include(dirname(__FILE__).'/init.php');
error_reporting(1);
$p=Product::getProducts(4, 0, 0, 'id_product', 'desc', false);
$products=Product::getProductsProperties(4, $p);
header("Content-Type: text/xml");
echo '<?xml version="1.0" encoding="utf-8"?>
<SHOP>';
foreach ($products as $row) {
$kategorie=array();
$category = new Category(intval($row['id_category_default']), 4);
while ($category->id <> 1) {
$kategorie[]=$category->hideCategoryPosition($category->name);
$category = new Category(intval($category->id_parent), 4);
}

$img=Product::getCover($row['id_product']);
echo '
<SHOPITEM>
<ITEM_ID>'.$row['id_product'].'</ITEM_ID>
<PRODUCTNAME>'.str_replace("&", "and", strip_tags($row['name'])).'</PRODUCTNAME>
<DESCRIPTION>'.str_replace("&", "&",strip_tags($row['description_short'])).'</DESCRIPTION>
<PRICE_VAT>'.($row['price']*1).'</PRICE_VAT>
<MANUFACTURER>'.htmlspecialchars($row['manufacturer_name']).'</MANUFACTURER>
<CATEGORY>'.implode(' > ',array_reverse($kategorie)).'</CATEGORY>
<URL>'.$row['link'].'</URL>
<IMGURL>http://www.xxx'.$row['id_product'].'xxx'.$img['xxx'].'.jpg</IMGURL>
<AVAILABILITY>Skladem</AVAILABILITY>
</SHOPITEM>';
}
echo '</SHOP>';
?>

Edited by tomas (see edit history)
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...