【问题标题】:Rest Api to get Products how to pass filter “status” and “visibility”Rest Api 获取产品如何通过过滤器“状态”和“可见性”
【发布时间】:2015-03-18 06:29:26
【问题描述】:
$apiUrl = 'http://192.168.1.7/xxxx/api/rest';

...

$oauthClient->setToken($_SESSION['token'], $_SESSION['secret']);

$resourceUrl = "$apiUrl/products?page=1&limit=5";

$oauthClient->fetch($resourceUrl, array(), 'GET', array('Content-Type' => 'application/json', 'Accept' => '*/*'));
$productsList = json_decode($oauthClient->getLastResponse());

print_r($productsList);
exit;

我有使用 rest api 的产品列表,但我想要一个过滤器 status=1visibility=4

【问题讨论】:

    标签: api rest magento magento-1.9


    【解决方案1】:
    $apiUrl/products?page=1&limit=5&filter[0][attribute]=status&filter[0][eq]=1&filter[1][attribute]=visibility&filter[1][eq]=4
    

    但在尝试之前,请确保您可以通过以下方式查看和过滤 状态和知名度。

    您可以从 System->Web Services->Rest 设置允许的属性 属性并选择您正在使用的角色(管理员、客户或 客人)。

    More info for filter

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-10-02
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多