我正在尝试通过Magento SOAP API V2获取“已启用”产品列表 为此,我建立了一个如下过滤器。但不幸的是,我总是检索所有产品,无论状态如何。
function GetProductList(sessionID: string; Store_View_ID: integer): catalogProductListResponseParam;
var
mycatalogProductListRequestParam: catalogProductListRequestParam;
my_ae: associativeEntity;
my_complex_filter_array: complexFilterarray;
my_complex_filter: complexFilter;
my_filter: filters;
begin
my_filter := filters.Create;
SetLength(my_complex_filter_array, 1);
my_ae := associativeEntity.Create;
my_ae.key := '=';
my_ae.value := '1';
my_complex_filter := complexFilter.Create;
my_complex_filter.key := 'status';
my_complex_filter.value := my_ae;
my_complex_filter_array[0] := my_complex_filter;
my_complex_filter := nil;
my_ae := nil;
my_filter.complex_filter := my_complex_filter_array;
mycatalogProductListRequestParam := catalogProductListRequestParam.Create;
mycatalogProductListRequestParam.sessionId := sessionID;
mycatalogProductListRequestParam.store := IntToStr(Store_View_ID);
mycatalogProductListRequestParam.filters := my_filter;
result := mage.catalogProductList(mycatalogProductListRequestParam);
my_filter := nil;
mycatalogProductListRequestParam := nil;
end;
看来,我只能过滤属性,这些属性是返回数据的一部分 有人知道如何获得已启用产品的列表吗?
霍尔格
答案 0 :(得分:0)
我发现了,为什么它不起作用。如果您指定" store",Magento无法在此调用中应用过滤器。如果您跳过提交storeview_id,则结果将按状态为" 1"的产品进行过滤。