Saldor Posted May 1, 2016 Share Posted May 1, 2016 (edited) This is the imported file: <?xml version="1.0" encoding="windows-1251"?> <oscommerce> <products> <product> <products_id>573</products_id> <products_name>Глинозем Г-001</products_name> <products_quantity>0</products_quantity> <products_price>0.0000</products_price> <products_date_available></products_date_available> <products_status>1</products_status> </product> </products> </oscommerce> Here is the file for import through this plugin adds an item to the root directory of goods . What you need to correct, so he was added to the category of goods . And even if it is necessary to edit the plug-in itself (oscommerce_xml.php), for the emergence of the possibility of adding the category . That's part of the code of the plug-in listing the existing props to add . What part of the code you need to shell out to have been vividly to help me ? This is the part of code(oscommerce_xml.php) $categories_ids[]=$categories_id; $current_categories_id = get_categories_ids($_POST['categories_id']); if(is_array($_POST_categories_id)){ $categories_ids=array_merge($_POST_ids, $_POST_categories_id); } $categories_ids = array_filter($categories_ids); $products=tep_db_query("select * from ".TABLE_PRODUCTS." left join ".TABLE_PRODUCTS_DESCRIPTION." using(products_id) left join ".TABLE_PRODUCTS_TO_CATEGORIES." using(products_id) where language_id='".$languages_id."' and categories_id in (".implode($categories_ids, ', ').")"); if (tep_db_num_rows($products)) { $xml_file.="<?xml version=\"1.0\" encoding=\"windows-1251\"?>\n"; $xml_file.="<oscommerce>\n"; $xml_file.=" <products>\n"; while ($product=tep_db_fetch_array($products)) { $xml_file.=" <product>\n"; $xml_file.=" <products_id>".$product['products_id']."</products_id>\n"; $xml_file.=" <products_name>".htmlspecialchars($product['products_name'])."</products_name>\n"; $xml_file.=" <products_quantity>".$product['products_quantity']."</products_quantity>\n"; $xml_file.=" <products_price>".$product['products_price']."</products_price>\n"; $xml_file.=" <products_date_available>".$product['products_date_available']."</products_date_available>\n"; $xml_file.=" <products_status>".$product['products_status']."</products_status>\n"; $xml_file.=" </product>\n"; } $xml_file.=" </products>\n"; $xml_file.="</oscommerce>\n"; } switch ($_POST['arc']) { case 'xml': $ext='.xml'; break; case 'zip': $ext='.xml.zip'; $zipfile = new zipfile(); $zipfile->addFile($xml_file, DB_DATABASE.'.xml'); $xml_file=$zipfile->file(); Sorry for the lenght, i don't see spoiler etc ... Edited May 1, 2016 by Saldor Quote Link to comment Share on other sites More sharing options...
Saldor Posted May 1, 2016 Author Share Posted May 1, 2016 oscommerce 2.3.4, PHP 5.2.... it's my site.... Or tell about another plugin to import goodies in xml to the my site... Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.