【发布时间】:2017-11-10 23:16:48
【问题描述】:
我已经重写了 Magento Core (M1.9) 的 Api 模型,并想测试它是如何工作的。它也返回可能的记录,我想在我的测试中设置像 Sql "order BY Desc|Asc" 和 "LIMIT" 这样的条件。但我不知道我应该把提到的条件放在哪里。 这是我的测试代码:
$username = 'testapi';
$apikey= 'password';
$client = new Zend_XMLRPC_Client('https://www.magentohost.com/index.php/api/xmlrpc');
$session = $client->call('login', array($username, $apikey));
$filters = array(
array(
'category_id' => 163,
'internal_rating' => 6
//array('product_id'=>'Order by ASC')
));
try {
$message = $client->call('call', array($session, 'catalog_product.list', $filters));
var_dump($message);
} catch (Exception $fault) {
echo $fault->getMessage();
}
如果有任何建议,我将不胜感激
【问题讨论】: