gpt4 book ai didi

php - 向 Magento Web 服务 API 添加过滤器

转载 作者:可可西里 更新时间:2023-11-01 13:04:19 26 4
gpt4 key购买 nike

我正在尝试调用 Magento SOAP API 并获取特定时间段内的订单列表。我可以连接到 API 并获得所有订单的列表,但我无法(终生)弄清楚如何过滤结果......有什么想法吗?我返回所有订单的代码如下...

$proxy = new SoapClient('http://lalala.freelunchlabs.com/api/v2_soap/?wsdl');

// create authorized session id using api user name and api key
$sessionId = $proxy->login('myusername', 'mypassword');

$filters = array(
'created_at' => array( '>' => '2011-04-21 02:13:00'),
'created_at' => array( '<' => '2011-04-21 02:22:00')
);

// Get order list
$orderinfo = $proxy->salesOrderList($sessionId,array($filters));

print_r($orderinfo);

提前致谢!

查克

最佳答案

我没有使用 Magento SOAP 2 Api 的经验,但如果 V2 中的过滤器与 V1 中的过滤器工作方式相同,你可以试试这个:

$filters = array(
'created_at' => array(
'from' => '2011-04-21 02:13:00',
'to' => '2011-04-21 02:22:00'
)
);

关于php - 向 Magento Web 服务 API 添加过滤器,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5844970/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com