douweng1935 2014-04-04 09:49
浏览 36
已采纳

Prestashop webservice PSWebServiceLibrary返回空订单详细信息

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.

  • 写回答

1条回答 默认 最新

  • douxing8855 2014-04-04 10:28
    关注

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

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?