Magento: Auto-changing the “Stock Availability” from “Out of Stock” to “In Stock” (& vice-versa) on Quantity Change

前端 未结 5 1574
刺人心
刺人心 2020-12-29 15:46

So I’ve been looking for a way to change the Stock Availability back to In Stock when the quantity field is greater than 0. The system already automatically changes the Stoc

5条回答
  •  自闭症患者
    2020-12-29 16:29

    This is what I had to do

            var stock_data = new catalogInventoryStockItemUpdateEntity()
            {
                qty = quantity,
                is_in_stock = inStock,
                manage_stock = stockManaged,
                is_in_stockSpecified = true,
            };
    

    is_in_stockSpecified is important

    I used SOAP API to update stock status.

提交回复
热议问题