我正在使用 Magento API 的 SOAP v1,我正在尝试向属性添加选项。使用以下文档Link
这是我用作测试的代码
$attributeCode = "colour";
$optionToAdd = array(
"Label" => array(
array(
"store_id" => 1,
"value" => "Green"
)
),
"order" => 0,
"is_default" => 0
);
当我调用 API 时,它返回以下内容 -
<b>Fatal error</b>: Uncaught SoapFault exception: [108] Default option value is not defined
我一生都无法让它发挥作用。我从文档中还没有遗漏什么吗?!
最佳答案
我认为您可能必须为 store_id 0(管理员)定义一个值? 您仅为 store_id 1 定义一个值,但可能需要在管理中拥有一个值。
关于Magento product_attribute.addOption 要求默认选项,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13952711/