...
Here is the complete, detailed code you need in order to remove a customer:
Code Block |
---|
try { $webService = new PrestaShopWebservice('[http://mystoreexample.com/|http://mystore.com/]' , 'ZR92FNY5UFRERNI3O9Z5QDHWKTP3YIIT' , false); // Create an instance $opt['resource'] = 'customers'; // Resource to use opt['id'] = 3; // ID to use $webService->delete($opt); // Delete echo 'Client '.3.' successfully deleted!'; // If we can see this message, that means we have not left the try block } catch (PrestaShopWebserviceException $ex) { $trace = $ex->getTrace(); // Retrieve all info on this error $errorCode = $trace[0]['args'][0]; // Retrieve error code if ($errorCode == 401) echo 'Bad auth key'; else echo 'Other error: <br />'.$ex->getMessage(); // Display error message{color} } |
...
Again, if you have trouble, look at the code for from the 4-delete.php
sample file.