Hi,
I try to update a product with the webservice but no way, always got : 400 Bad request.
On customer i have no problem, it's only on products.
My Prestashop is a new install, version 1.7.
I use https://github.com/PrestaShop/PrestaShop-webservice-lib for an easy way.
There is my code :
define('DEBUG', true);
define('PS_SHOP_PATH', 'http://prestashopdomain.com');
define('PS_WS_AUTH_KEY', '8XKBE7ZK3ZSRExxxxxxxxxQLR2MXF');
require_once('./PSWebServiceLibrary.php');
$webService = new PrestaShopWebservice(PS_SHOP_PATH, PS_WS_AUTH_KEY, DEBUG);
$opt = array('resource' => 'products');
$opt['id'] = '1';
$xml = $webService->get($opt);
$resources = $xml->children()->children();
$resources->reference = 'demo_3b';
$opt = array('resource' => 'products');
$opt['putXml'] = $xml->asXML();
$opt['id'] = '1';
try {
$webService->edit($opt);
} catch (PrestaShopWebserviceException $ex)
{
echo $ex->getMessage();
}
As you see, nothing particular...
Can somebody help me ? Thanks :-)