Jump to content

zatox

Members
  • Posts

    2
  • Joined

  • Last visited

zatox's Achievements

Newbie

Newbie (1/14)

0

Reputation

  1. hi WildeThang, yes thats true, it otputs only one category not the full tree. I need this for one of my projects. So if you can help, i would be very thankfull thanks Hoodgrown i will check your links
  2. Hi, thank you for such a great product Here is a problem. I need to export product info to .xml file. But script can not get category information (Category name, Full Category info, Category info), all other info are works sussesfully. Here is a structure of XML i want to get <xml version='1.0' encoding='utf-8'> //works <link></link> //works //works //works // not working // not working // not working </xml> and there is a php code <?php include(dirname(__FILE__).'/config/config.inc.php'); error_reporting(1); $xml = 'productlist.xml'; /*code from another forum member */ $p=Product::getProducts(3, 0, 0, 'id_product', 'desc', false); $id_category =Tools::getValue('id_category'); $id_category = $product->id_category_default; $products=Product::getProductsProperties(3, $p); $line='<?xml version="1.0" encoding="utf-8"?>'; $line.="\r\n"; $line.="<xml>\r\n"; foreach ($products as $row) { $kategorie=array(); $category = new Category(intval($row['id_category_default']), intval(10)); while ($category->id <> 1) { $kategorie[]=$category->hideCategoryPosition($category->name); $category = new Category(intval($category->id_parent), intval(10)); } $img=Product::getCover($row['id_product']); $line.="\r\n"; $line.=' '.str_replace('&','&',$row['name']).''; $line.="\r\n"; $line.=' <link>http://www.example.com'.$row['link'].'</link>'; $line.="\r\n"; $line.=' '.($row['price']*1).''; $line.="\r\n"; $line.=' http://www.example.com/img/p/'.$row['id_product'].'-'.$img['id_image'].'-home.jpg'; $line.="\r\n"; $line.=' '; /* i used '.implode('>',array_reverse($kategorie)).' but didn't worked how to get ??? */ $line.=" \r\n"; /* for example Cars -> Ford how to get ??? */ $line.=" \r\n"; /* how to get ??? */ $line.="\r\n"; } $line.= "</xml>\r\n"; $h=fopen($xml,"w+"); fwrite($h,$line); fclose($h); echo '<html><center>XML file updated</html>' ?> Maybe someone can help? Thanks
×
×
  • Create New...

Important Information

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