prestashop 1.6 adding product with webservice
<p>For Prestashop 1.6.1.7
Hello,
I have a section in my site visitors they can express their product (second-hand) with features such as multiple photos, product name, product price, contact the seller, description, keywords (optional) them.
I'm going through prestashop webservice after the form is submitted and record on second-hand product categories,
Categories ID is 994.
I wrote this code:</p>

<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;?php
$shop_url = 'http://subdomain.test.com';
$secret_key = '9CQEDRKAD5IF8C9FFPP59T7AJSCPIW2Q';
$debug = true;
 
require_once('./PSWebServiceLibrary.php');
 
 try {
  $webService = new PrestaShopWebservice($shop_url, $secret_key, $debug);
  $xml = $webService-&gt;get(array('url' =&gt; $shop_url.'/api/products?schema=blank'));
  $resources = $xml-&gt;children()-&gt;children();
  
  if (!isset($_POST['btn_submit']))
  {
   $html = '&lt;form action="" method="POST"&gt;&lt;table border=1&gt;';
   foreach ($resources as $key =&gt; $resource)
   {
    $html .= '&lt;tr&gt;&lt;th&gt;'.$key.'&lt;/th&gt;&lt;td&gt;';
    $html .= '&lt;input type="text" name="form['.$key.']" value=""/&gt;';
    $html .= '&lt;/td&gt;&lt;/tr&gt;';
   }
   $html .= '&lt;td colspan=2&gt;&lt;input type="submit" name="btn_submit" value="btn_submit" /&gt;&lt;/td&gt;';
   $html .= '&lt;/table&gt;&lt;/form&gt;';
   echo $html;
  }
  else
  {
   foreach ($resources as $nodeKey =&gt; $node)
   {
    $resources-&gt;$nodeKey = $_POST['form'][$nodeKey];
   }
   
   try {  
    $opt = array('resource' =&gt; 'products');
    $opt['postXml'] = $xml-&gt;asXML();
    $xml = $webService-&gt;add($opt);
    echo "Successfully added.";   
   }
   catch(PrestaShopWebserviceException $ex) {
    echo 'Other error: &lt;br /&gt;' . $ex-&gt;getMessage();
   }
  }
 }
 catch (PrestaShopWebserviceException $ex) {
  echo 'Other error: &lt;br /&gt;' . $ex-&gt;getMessage();
 }
?&gt;</code></pre>
</div>
</div>
</p>

<p>this is add_product.php in prestashop root folder.
PSWebServiceLibrary.php in prestashop root folder.</p>

<p>Why not working properly, and how can I sum up the form that the product name, product description, product price.</p>

<p>screentshot attached.</p>

<p><a href="https://i.stack.imgur.com/ucbGJ.png" rel="nofollow noreferrer">enter image description here</a></p>