Question

To get a particular shop orders, I am using PSWebServiceLibrary.php from LINK on prestashop 1.6.

This is my code

require_once 'PSWebServiceLibrary.php';
$opt['id'] = 1; // Looking for details for order 1 
$opt['resource'] = 'orders';

// Call
$webService = new PrestaShopWebservice('http://myprestashop_shop_url.com', '*****', true);
$xml = $webService->get($opt);

$resources = $xml->children()->children();

echo '<pre>';
    print_r($resources);
echo '</pre>';


RETURN HTTP BODY has returned all the values I am looking for as shown on pic1.

pic1

But $resources returned empty values as shown on pic2. pic2

NOTE: In the Advance Parameters/Webservice I have enabled all including order_details and order_histories.

Was it helpful?

Solution

$resources is not empty, it contains SimpleXMLElement Objects. Try echo $resources->id.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top