我使用rest api在我的Magento上創建一個簡單的產品。除了數量欄在 "數量 "欄上正確更新,但在可銷售的數量上沒有更新外,所有的作業都是正確的
。休息呼叫。"www.mysite.com/V1/products"
陣列資料
$data = [
"product" => [
"sku" => $sku,
"name" => $product_title,
"attribute_set_id" => 4,
"price" => $price,
"status" => 1,
"visibility" => 4,
"type_id" => "簡單"。
"weight" => "1",
"extension_attributes" => [
"category_links" => [
[
"position" => 0,
"category_id" => "53".
]
],
"stock_item" => [
"qty" => $qty,
"is_in_stock" => true; $qty.
]
],
"custom_attributes" => [
[
" attribute_code" => "special_price",
"value" => $salable_price
],
[
"attribute_code" => "special_from_date"。
"value" => "2021-02-07 00:00:00".
],
[
" attribute_code" => "special_to_date",
"value" => "2091-02-07 00:00:00".
],
[
"attribute_code" => "cost"。
"value" => $salable_price
],
[
"attribute_code" => "description"。
"value" => $description
],
[
" attribute_code" => "short_description"。
"value" => $short_description
]
]
]
];
正如你所看到的,qty已經正確地在qty列上更新了,但在可售數量上卻沒有。我的錯誤是什么?
uj5u.com熱心網友回復:
請試試這個
""/span>stockItem""/span>:{
""is_in_stock"": 1,
""qty": 10,
""manage_stock"": true。
""use_config_manage_stock"": 1
}
轉載請註明出處,本文鏈接:https://www.uj5u.com/ruanti/320581.html
標籤:

