Bumbe86 Posted November 20, 2013 Share Posted November 20, 2013 Buonasera, Sto creando una webService per aggiornare i prodotti dello store. Ho seguito la guida http://doc.prestashop.com/display/PS14/Chapter+5+-+Modification+-+Update+client $webService = new PrestaShopWebservice('http://miodominio/shop' 'valueKey', true); try { // Define the resource $opt = array( 'resource' => 'products' ); // Define the resource id to modify $opt[ 'id' ] = 2; // Call the web service, recuperate the XML file $xml = $webService->get( $opt ); // Recuperate resource elements in a variable (table) $resources = $xml->children()->children(); foreach ( $resources as $nodeKey => $node ) { if($nodeKey=='price'){ $resources->$nodeKey = '330'; } } $opt = array( 'resource' => 'products' ); // Resource definition $opt[ 'putXml' ] = $xml->asXML(); //XML file definition $opt[ 'id' ] = 2; // Definition of ID to modify // Calling asXML () returns a string corresponding to the file $xml = $webService->edit( $opt ); // Call } catch (PrestaShopWebserviceException $ex) { // Shows a message related to the error echo 'Other error: <br />' . $ex->getMessage(); } Mi viene mostrato questo messaggio di errore "Other error: This call to PrestaShop Web Services failed and returned an HTTP status of 400. That means: Bad Request." Qualcuno può aiutarmi grazie. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now