2

I need to update my stock everyday in magento 2 but i dont know how it works.

Do i have to import the same full stock with all columns of my stock.csv and set the qty,is in stock columns with new values ?

or a csv file with only sku,qty,stock availabilty columns?

or a full csv file with all column but only the sku,qty, stock availablity filled ?

Hope somebody could help me.

3

In order to update stock in Magento 2 using csv, for most scenarios, you will only need to include 'sku' and 'qty' columns.

However, I am assuming for the products in question you already have stock management turned on either globally or per product and you are not using 'backorders'. For more details on advanced stock management see the Magento documentation: http://docs.magento.com/m2/ce/user_guide/catalog/inventory-product-stock-options.html

'is_in_stock' (which maps to 'Stock Availability') is not required either as in most scenarios (based on assumptions above) Magento will auto set this based on whether you provide a stock qty of above 0 or not (i.e. qty of 0 or less will set 'Out of Stock', 1 or above will set 'In Stock')

Finally, the value in the 'qty' column is always the full stock value (not the value you want to increase/decrease by). Therefore a csv like the below is more than sufficient:

"sku","qty"
"SKU_CODE","100"

This would apply a qty of 100 to the product with SKU 'SKU_CODE' and set 'Stock Availability' to 'In Stock'

I hope that covers everything you need to get a successful import running, if not let me know :)

  • It is not working. Also, there is no error in log. – Sudipta Dhara Jan 14 at 5:57
0

We struggled with importing inventory changes in Magento 1; the issue was resolved when we started using OpenOffice spreadsheets instead of Excel. Our Magento 2 store doesn't seem to like Excel either, and OpenOffice works perfectly.

Make sure you have the column headers right, they must be exactly as Magento has them (sku, not SKU, etc).

Create the spreadsheet using only the columns you need to update (of course, the first column will be sku, even though you're not updating the SKUs). If you're unsure of the column headers, you can export your current item list (System > Export). Again, the headers on your spreadsheet must be exactly as Magento has them.

Populate the columns with appropriate data, but no formatting. Save as file type "Text CSV", name it whatever you want. In the "Field Options" window that pops up:

  • Character set is Unicode UTF-8
  • Field delimiter is ,
  • Text delimiter is "

This may help you avoid issues. Once you get it working it's cake, and you'll be glad you did because it makes updating inventory much faster and simpler!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.