How to import categories and images in Volusion using Volusion API in PHP
<p>Actually i am trying to import products to my volusion store via Volusion API using PHP cURL method, the products are insert and update successfully but there is an issues with category and images. images and categories are not inserted. </p>

<p>When i open my admin the categories and images are not assign. Untill i assign by manual then it show on front end.</p>

<p>Anyone knows please help me. My code as under..</p>

<ol>
<li>My XML file..</li>
</ol>

<p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
<div class="snippet-code">
<pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
    &lt;product&gt;
    &lt;productcode&gt;960BX2SSD1&lt;/productcode&gt;
    &lt;upc_code&gt;649528774156&lt;/upc_code&gt;
    &lt;productmanufacturer&gt;Crucial&lt;/productmanufacturer&gt;
    &lt;category&gt;SATA3&lt;/category&gt;
    &lt;categorytree&gt;&lt;/categorytree&gt;
    &lt;productprice&gt;259&lt;/productprice&gt;
    &lt;stockstatus&gt;Y&lt;/stockstatus&gt;
    &lt;productweight&gt;0.25&lt;/productweight&gt;
    &lt;length&gt;0&lt;/length&gt;
    &lt;width&gt;0&lt;/width&gt;
    &lt;height&gt;0&lt;/height&gt;
    &lt;photo_alttext&gt;960BX2SSD1.JPG&lt;/photo_alttext&gt;
    &lt;photourl&gt;http://www.malabs.com/i/960BX2SSD1.JPG&lt;/photourl&gt;
    &lt;productdescription&gt;&amp;lt;p&amp;gt;&amp;lt;b&amp;gt;SpecificationS&amp;lt;/b&amp;gt;&amp;lt;/p&amp;gt;&amp;lt;ul&amp;gt;&amp;lt;li&amp;gt;&amp;lt;strong&amp;gt;Mfr Part Number:&amp;lt;/strong&amp;gt; CT960BX200SSD1&amp;lt;/li&amp;gt;&amp;lt;li&amp;gt;&amp;lt;strong&amp;gt;Capacity:&amp;lt;/strong&amp;gt; 960 GB&amp;lt;/li&amp;gt;&amp;lt;li&amp;gt;&amp;lt;strong&amp;gt;Form Factor:&amp;lt;/strong&amp;gt;;&lt;/productdescription&gt;
  &lt;/product&gt;</code></pre>
</div>
</div>
</p>

<ol start="2">
<li>My PHP Script</li>
</ol>



<pre class="lang-html prettyprint-override"><code>&lt;?php

   $file = file_get_contents('dataPro.txt', true);

//  Create the Xml to POST to the Webservice

    $Xml_to_Send = "&lt;?xml version=\"1.0\" encoding=\"utf-8\" ?&gt;";
    $Xml_to_Send .= "&lt;Volusion_API&gt;";
//  $Xml_to_Send .= "&lt;!--";
    $Xml_to_Send .= $file;
//  $Xml_to_Send .= "\"\"";
//  $Xml_to_Send .= "--&gt;";
    $Xml_to_Send .= "&lt;/Volusion_API&gt;";


$url = "http://xxxxxxxxxxxxx/net/WebService.aspx?Login=xxxxxxxxxxxxx&amp;EncryptedPassword=xxxxxxxxxxx&amp;Import=Insert-Update";


//  Create the Header   

    //  Post and Return Xml
    $ch = curl_init();
    curl_setopt($ch, CURLOPT_URL,$url);
    curl_setopt($ch, CURLOPT_POST, true);
    curl_setopt($ch, CURLOPT_POSTFIELDS, $Xml_to_Send); 
    curl_setopt($ch, CURLOPT_HTTPHEADER, array("Content-Type:application/x-www-form-urlencoded; charset=utf-8", "Content-Action:Volusion_API"));
    $data = curl_exec($ch);

    //  Check for Errors
    if (curl_errno($ch)){

        print curl_error($ch);
    } else {

       curl_close($ch);
    }

   //  Display the Xml Returned on the Browser

   echo $data;

?&gt;
</code></pre>

<p>Where is the mistake that images and categories are missing.</p>