Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

oscommerce_xml.php 0.6. How to add the item to the category of goods?


Saldor

Recommended Posts

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 by Saldor
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...