在 Magento 1.5 中,像这样从 C# 访问 catalogProductInfo API 调用适用于非数字 SKU:
catalogProductRequestAttributes fetchattrib = new catalogProductRequestAttributes();
fetchattrib.attributes = new string[] { "name", "description", "and_so_on"};
fetchattrib.additional_attributes = new string[] { "custom_attribs_go_here"};
string storeView = null;
string productIdentifierType = null;
catalogProductReturnEntity ret = m_magentoClient.catalogProductInfo(
sessionId, sku, storeView, fetchattrib, productIdentifierType);
但是对于数字 SKU,我会收到“产品不存在”错误。
这大概是因为 Magento 无法判断您传递的是 product_id 还是 SKU。根据我能找到的所有文档,理论上,将 productIdentifierType 设置为“sku”应该可以解决这个问题:
...
string productIdentifierType = "sku";
...
但它不能解决它。
事实上,这似乎使情况变得更糟,Magento 然后停止查找非数字 SKUS。
所以大概"sku"
不是传递的正确值。
有人有什么想法吗?