Magento API v2按自定义属性过滤

num*_*l25 1 php soap magento

我一直在寻找网络,但我似乎无法找到任何例子,我已经尝试过,但失败了.我正在使用api的第2版,我想找到按客户属性过滤的产品......

$filter = array(
        array(
            'key'=>'custom_attribute',
            'value'=>"463"
        )
);
$products = $client->catalogProductList($session,array(
    'filter'=>$filter
)); 
Run Code Online (Sandbox Code Playgroud)

但我得到的是所有产品,而不是我要找的具体产品.有什么我做错了吗?有什么我想念的吗?

Man*_*e K 6

请尝试以下代码.

$complexFilter = array (
    'complex_filter' => array(
        array(
        'key' => 'custom_attribute',
            'value' => array(
                'key' => 'eq', 
                'value' => '463'
            )
        )
    )
);
$products = $client->catalogProductList($session, $complexFilter);
Run Code Online (Sandbox Code Playgroud)