如何通过 API 仅更新一个 woocommerce 产品属性
How to update just ONE woocommerce product attribute via API
我有一个产品的属性“颜色”喜欢这个
$productData = [
'name' => product name,
'type' => 'variable',
'sku' => 123,
'regular_price' => $row['price'],
'attributes' => [
[
'name' => 'Colors',
'visible' => true,
'variation' => true,
'options' => ['red','green','blue'],
]
]
];
现在我要做的是更新此选项数组并在此处添加新颜色。我没有在文档中找到任何关于如何实现它的内容。
我有一个产品的属性“颜色”喜欢这个
$productData = [
'name' => product name,
'type' => 'variable',
'sku' => 123,
'regular_price' => $row['price'],
'attributes' => [
[
'name' => 'Colors',
'visible' => true,
'variation' => true,
'options' => ['red','green','blue'],
]
]
];
现在我要做的是更新此选项数组并在此处添加新颜色。我没有在文档中找到任何关于如何实现它的内容。