Jump to content

how build miror site XML


Recommended Posts

hello,
i need build a mirror site to my prestashop
i need that will be in XML

someone in the forum five me this code:

<?php
$shopUrl = 'http://www...........cz';  
include(dirname(__FILE__).'/config/config.inc.php');
include(dirname(__FILE__).'/init.php'); 
error_reporting(0);
$p=Product::getProducts(3, 0, 0, 'id_product', 'desc', false);
$products=Product::getProductsProperties(3, $p);

header("Content-Type: text/xml");
echo '<?xml version="1.0" encoding="utf-8"?>

N?zev va?eho obchodu
www........cz/';

foreach ($products as $row) {

$kategorie=array();
$category = new Category(intval($row['id_category_default']), intval(3));
while ($category->id <> 1) {
   $kategorie[]=$category->hideCategoryPosition($category->name);
   $category = new Category(intval($category->id_parent), intval(3));
}

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

'.str_replace("&", "&", $row['supplier_name']).'
'.str_replace("&", "&", $row['manufacturer_name']).'
'.str_replace("&", "and", strip_tags($row['name'])).'
'.str_replace("&", "and", strip_tags($row['description_short'])).'
'.str_replace("&", "and", strip_tags($row['description'])).'
'.implode('>',array_reverse($kategorie)).'
'.$row['link'].'
http://www.......com/img/p/'.$row['id_product'].'-'.$img['id_image'].'-home.jpg
'.$row['tax_rate'].'
'.($row['price']*1).'
'.($row['reduction_price']*1).'
'.($row['wholesale_price']*1).'
'.($row['quantity']*1).'
'.$row['reduction_percent'].'
'.$row['reduction_from'].'
'.$row['reduction_to'].'
'.$row['on_sale'].'
'.$row['available_now'].'
'.$row['available_later'].'
'.$row['supplier_reference'].'
'.$row['reference'].'
'. round($row['ean13']) .'
';
}
echo '';
?> 




but i need division according category

to example:

computer category = computer . XML
movies category = movies.xml

so i everybody can help me its will great

thank you alot

Link to comment
Share on other sites

<?php
$shopUrl = 'http://www.presta.bazarhudebnin.cz';      // url your shop
include(dirname(__FILE__).'/config/config.inc.php'); 
include(dirname(__FILE__).'/init.php');
error_reporting(0);
$p=Product::getProducts(3, 0, 0, 'id_product', 'desc', false); // 3 - ID your language
$products=Product::getProductsProperties(3, $p); // 3 - ID your language

header("Content-Type: text/xml");
echo '<?xml version="1.0" encoding="utf-8"?>
';
foreach ($products as $row) {
$img=Product::getCover($row['id_product']);
echo '

'.str_replace("&", "&", $row['name']).'
'.str_replace("&", "&",strip_tags($row['description_short'])).'
'.$row['link'].'
'.$shopUrl.'/img/p/'.$row['id_product'].'-'.$img['id_image'].'.jpg
'.($row['price']*1).'
0
';
}
echo '';
?> 

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...