I have been trying for a long time to update the status of an order from php with the prestashop webService library.
First I have tried to download the order, modify the "current_state" attribute and upload it via edit, without positive result, I always get the error message "other error"
Now I have seen that you can add an entry in "order_histories" but I am also unable to make it work:
$estadoID = (int)$_POST['estadosSelect'];
$idPedido = $_GET['id'];
$tienda = $_GET['tienda'];
$webService = $this->webServiceTienda($tienda);
try{
$opt = [
'resource' => 'order_histories?schema=blank'
];
$xml = $webService->get($opt);
$resources = $xml->children()->children();
var_dump( $resources );
$resources->id_order = $idPedido;
$resources->id_employee = 0;
$resources->id_order_state = $estadoID;
var_dump( $resources );
$opt = [
'resource' => 'order_histories',
'postXml' => $xml->asXML()
];
$createdXml = $webService->add($opt);
var_dump( $createdXml );
}catch (PrestaShopWebserviceException $e){
$this->controlErrores($e);
}
I keep getting the error code "other error", I have seen several examples, but I don't get it, any help is welcome: D
var_dumps
question from:
https://stackoverflow.com/questions/66048131/prestashop-webservice-api-update-order-status 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…