zatox Posted March 30, 2009 Share Posted March 30, 2009 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 Link to comment Share on other sites More sharing options...
WildeThang Posted April 23, 2009 Share Posted April 23, 2009 Hi zatoxWere you able to solve this ??????I'm looking to do the exact same thingI have tried your method - but it only seems to output 1 categoryIs there a way of outputting every single product in the store ????CheersWildeThang Link to comment Share on other sites More sharing options...
Hoodgrown Posted April 23, 2009 Share Posted April 23, 2009 I don't know if this will help but the Googlebase module exports products in an xml format.http://www.ecartservice.net/tag/googlebase/ Link to comment Share on other sites More sharing options...
WildeThang Posted April 23, 2009 Share Posted April 23, 2009 Cheers mateI've give it a go Link to comment Share on other sites More sharing options...
Hoodgrown Posted April 23, 2009 Share Posted April 23, 2009 Let me know how it works out for you. Link to comment Share on other sites More sharing options...
zatox Posted April 23, 2009 Author Share Posted April 23, 2009 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 Link to comment Share on other sites More sharing options...
istox Posted December 13, 2010 Share Posted December 13, 2010 Zatox Do you resolved the last 3 lines? // not working // not working // not working Link to comment Share on other sites More sharing options...
MrGubu Posted April 25, 2011 Share Posted April 25, 2011 I've found the full path of product category. Using the same code as before: foreach ($products as $row) { ... $path= Tools::getFullPath(intval($row['id_category_default']), $row['name']) ; $path=strip_tags($path); echo ''.$path.''; ... } Hope this will be useful for somebody. Link to comment Share on other sites More sharing options...
muratssu Posted September 12, 2011 Share Posted September 12, 2011 I don't know if this will help but the Googlebase module exports products in an xml format. http://www.ecartserv...tag/googlebase/ Hello; I can receive an xml file from this module but as my site is in Turkish, i have Turkish character problems. Does anyone know what i can do? Thx Link to comment Share on other sites More sharing options...
Recommended Posts