Jump to content

REST API in version 1.5.3.1


Recommended Posts

Problem add in "categories" and "products"

 

return xml server:

 

<?xml version="1.0" encoding="UTF-8"?>
<prestashop xmlns:xlink="http://www.w3.org/1999/xlink">
<errors>
<error>
<code><![CDATA[93]]></code>
<message><![CDATA[parameter "position_in_category" not writable. Please remove this attribute of this XML]]></message>
</error>
</errors>
</prestashop>

 

example code:

 

try
{
$service = new PrestaShopWebservice(PS_SHOP_PATH,PS_WS_AUTH_KEY,DEBUG);

$xml = $service->get(array('resource' => 'products?schema=synopsis'));
$res = $xml->children()->children();

$res->price = 0;
$res->link_rewrite = 'test';
$res->name = 'test';

$opt = array('resource' => 'products');
$opt['postXml'] = $xml->asXML();
$xml = $service->add($opt);

}
catch (PrestaShopWebserviceException $ps)
{
echo 'Error: '.$ps->getMessage();
}

 

How to fix it?

Edited by kixiro (see edit history)
Link to comment
Share on other sites

×
×
  • Create New...