2013-02-06 72 views
1

我一直在尋找所有的網絡,但我似乎無法找到任何示例,我已經嘗試過但失敗。我現在用的是API的第2版,我想找到產品,由客戶屬性,像這樣過濾器...自定義屬性Magento API v2過濾器

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

但我讓所有的產品,而不是我要找的特定產品。有什麼我做錯了嗎?有什麼我失蹤?

回答

6

請嘗試下面的代碼。

$complexFilter = array (
    'complex_filter' => array(
     array(
     'key' => 'custom_attribute', 
      'value' => array(
       'key' => 'eq', 
       'value' => '463' 
      ) 
     ) 
    ) 
); 
$products = $client->catalogProductList($session, $complexFilter); 
+0

感謝您的回覆。這似乎並沒有工作。扔肥皂錯誤。 – numerical25

+0

我的用戶錯誤,它的工作。謝謝 – numerical25

+0

我有圓頂相同,但沒有得到響應。我有屬性代碼'productsizes',attribute_id是151和值是5,如何過濾產品與這些 – Akhil

相關問題