【问题标题】:Magento API SOAP filter website_ids errorMagento API SOAP 过滤器 website_ids 错误
【发布时间】:2014-08-14 03:38:49
【问题描述】:

每次我在过滤器中添加 website_ids 时,我都使用 api soap v1 并调用 catalog_product.list 会导致错误。

$filter = array( 
'status' => array( '=' => 1 ), 
'type_id' => array( '=' => 'simple' ), 
'website_ids' =>  array('6'),
); 

第二个问题,catalog_product.list 的 args 是 filter 和 storeView,如果我添加商店视图 id 或代码,我会显示所有我猜想的产品它会忽略我添加的内容。

$proxy->call($sessionId, 'catalog_product.list', $filter = null, '6');

谢谢

【问题讨论】:

    标签: api magento soap magento-1.8


    【解决方案1】:

    我找到了这个解决方案。

    //you're website's id
    $result = $client->call($session, 'store.info', '6');
    $code = $result['code'];
    
    //here all filters, in 'filters' you can add others filters (like price for example)    
    $filters = array(
        'filters' => array(
            'status' => 1, 
            'type_id' => 'simple',
        ),
        'storeView' => "$code"
    );
    
    try{
        $result = $client->call($session, 'catalog_product.list',$filters);
    } catch (Exception $e){
        print_r($e);
    }
    print_r($result);
    

    现在可以了吗? :)

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2012-08-30
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-09-01
      相关资源
      最近更新 更多