int for security measures // Call $xml = $webService->get($opt); // Here we get the elements from children of customer markup which is children of prestashop root markup $resources = $xml->children()->children(); } catch (PrestaShopWebserviceException $e) { // Here we are dealing with errors $trace = $e->getTrace(); if ($trace[0]['args'][0] == 404) echo 'Bad ID'; else if ($trace[0]['args'][0] == 401) echo 'Bad auth key'; else echo 'Other error'; } // We set the Title echo '

Customers '; if (isset($_GET['id'])) echo 'Details'; else echo 'List'; echo '

'; // We set a link to go back to list if we are in customer's details if (isset($_GET['id'])) echo 'Return to the list'; echo ''; // if $resources is set we can lists element in it otherwise do nothing cause there's an error if (isset($resources)) { if (!isset($_GET['id'])) { echo ''; foreach ($resources as $resource) { // Iterates on the found IDs echo ''; } } else { foreach ($resources as $key => $resource) { // Iterates on customer's properties echo ''; echo ''; echo ''; } } } echo '
IdMore
'.$resource->attributes().''. 'Retrieve'. '
'.$key.''.$resource.'
'; ?>