简体   繁体   English

使用SOAP Magento按商店获取所有类别

[英]Get all categories by store with SOAP Magento

I can see in Magento docs that categories.tree can be called with an optional store view parameter, but I can't make it work. 我可以在Magento文档中看到,可以使用可选的store view参数调用category.tree,但是我无法使其工作。

I am doing the following: 我正在执行以下操作:

$store = 'gl'; // This is my store view code
return self::$client->call( self::$session, 'catalog_category.tree' , $store );

But I get a SOAP error. 但是我收到一个SOAP错误。 How showld I do it? 我如何表现呢?

Thanks 谢谢

$client->call(self::$session, 'catalog_category.tree' , null, $store );

You are not passing the second parameter, that ( as per documentation ) corresponds to the parentId, and I think that you want to ignore it. 您没有传递第二个参数,该参数( 根据文档 )对应于parentId,我认为您想忽略它。

The equivalent call for the SOAPv2 API would be: SOAPv2 API的等效调用为:

$client->catalogCategoryTree(self::$session, null, $store);

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM