Jump to content

Modifier le prix d'un article par webservice


Recommended Posts

Bonjour,

 

J'ai essayé de modifier le prix d'un article avec webservice mais ça marche pas.

$ID = getProductId($data[0]);
echo("<br/>L'ID du produit est : ".$ID."<br/>\n");
					    
// Define the resource
$opt = array('resource' => 'products');
// Define the resource id to modify
$opt['id'] = $ID;
// Call the web service, recuperate the XML file
$xml = $webService->get($opt);
// Recuperate resource elements in a variable (table)
$resources = $xml->children()->children();

$resources->price = 20.910000; 
$opt = array('resource' => 'products');
$opt['putXml'] = $xml->asXML();
$opt['id'] = $ID;
$xml = $webService->edit($opt);	
L'ID du produit est : 388

This call to PrestaShop Web Services failed and returned an HTTP status of 400. That means: Bad Request.
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...