IeM Posted July 21, 2013 Posted July 21, 2013 (edited) Hi, As a customer joins another site ( , I need a script to call the Prestashop webservice from that site to update that user's customer id_default_group value in site A. We already know the user's Prestashop Id and what the new group Id should be. So far I have the following (error checking not included): require_once( './PSWebServiceLibrary.php'); $webService = new PrestaShopWebservice($siteUrl, $key, false); $opt = array('resource'=>'customers','display'=> '[id_default_group]','filter[id]' => $id); $xml = $webService->get($opt); $resources = $xml->children()->children(); //?????????? The correct element location is $xml->children()->children()->children; I do not want to view the details or manually update them. The script needs to take the known id_customer and new id_default_group value and use them to automatically update Prestashop (Site A from . I do not know how to update the id_default_group value in the returned data and create/format the data to send back. This almost works: $xml->customers->customer->id_default_group = 4; $resources = $xml->children()->children()->children(); As it sets the correct child element but when it is sent back the header response is "HTTP/1.1 400 Bad Request". Thanks for your assistance. Edited August 4, 2013 by IeM (see edit history) Share this post Link to post Share on other sites More sharing options...
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
Already have an account? Sign in here.Sign In Now