订单过滤-PrestaShop API

时间:2019-08-02 14:39:46

标签: php api prestashop

TL; DR 无法按product_id筛选订单。用作参数时,整个请求的答案是HTTP400。

因此,我想获取特定产品的订单总数。还有其他方法可以实现吗?

我使用的是官方PrestaShopWebservice类,我的查询如下所示:

      $xmlResponse = $webService->get(
        [
          'resource' => 'orders',
          'display'  => 'full',
          'output_format' => 'JSON',
          'filter[product_id]' => $id,
          'filter[valid]' => 1
        ]
      );

我得到的错误:

Fatal error: Uncaught PrestaShopWebserviceException: This call to PrestaShop Web Services failed and returned an HTTP status of 400. That means: Bad Request.

非常感谢! :)

0 个答案:

没有答案