Jump to content

Edit price with webservice


Recommended Posts

Hi,

 

I want to edit the price of a product with webservice and php.I use this code but not working :

This call to PrestaShop Web Services failed and returned an HTTP status of 400. That means: Bad Request.

$xml = $webService->get(array('url' => $url.'/api/products?schema=blank'));
$productP = $xml->children()->children();
$productP->price = 20; //Prix TTC
$productP->wholesale_price = 89; //Prix d'achat
$opt2 = array('resource' => 'products');
$opt2['putXml'] = $xml->asXML();
$opt2['id'] =  $result;//with $result the id of product
$xml = $webService->edit($opt2); 
Link to comment
Share on other sites

I have inspired from this page:

https://github.com/PrestaShop/PrestaShop-webservice-lib/blob/master/examples/Update.php

 

this code work with customers but not with products !!!!

I have the same error:

This call to PrestaShop Web Services failed and returned an HTTP status of 400. That means: Bad Request.

 

Any idea how fixed this PLZ!

Edited by NeedZoom (see edit history)
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...