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.

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

报告相同问题?

悬赏问题

  • ¥15 乌班图ip地址配置及远程SSH
  • ¥15 怎么让点阵屏显示静态爱心,用keiluVision5写出让点阵屏显示静态爱心的代码,越快越好
  • ¥15 PSPICE制作一个加法器
  • ¥15 javaweb项目无法正常跳转
  • ¥15 VMBox虚拟机无法访问
  • ¥15 skd显示找不到头文件
  • ¥15 机器视觉中图片中长度与真实长度的关系
  • ¥15 fastreport table 怎么只让每页的最下面和最顶部有横线
  • ¥15 java 的protected权限 ,问题在注释里
  • ¥15 这个是哪里有问题啊?