Import PrestaShop stock, increase or decrease stock quantities in the database by file
This very simple tutorial addresses two classic cases:
Case 1: you have several suppliers for the same products and wish to accumulate or add their stocks in the PrestaShop quantity field.
Case 2: you also sell in physical stores, at fairs, shows or markets, without a cash register tool synchronized with PrestaShop. You record your external sales in a small Excel file, and when you return, you'd like to update the inventory in PrestaShop by subtracting the quantities sold, recorded in this file.
.
Preamble, how to perform a csv import or xls import in PrestaShop
This tutorial won't go into detail about this type of work again, but will focus on inventory management. If you've never done a file import via Merlin, please see or review the various tutorials in this category.
Modify quantities via import, by addition or subtraction
A very simple file is all you need, with just two columns, one containing the quantities to be added to or subtracted from the currently known quantities, and a second column to identify the products (or variations), for example their PrestaShop Id, or reference or barcode. The name and order of the columns doesn't matter, as long as they each have a distinct title. Like this one, for example:
| sku | qty |
| 100733 | 10 |
| 101011 | 5 |
| 101021 | 8 |
Of course the file could be more complex, with lots of other columns, if it's a supplier file. Who can do more can do less. The important thing is to have at least one column with quantities and another serving as a sync key.
Classical stock update import
For a classic import, which simply updates stocks by replacing known quantities with those in the file, we proceed as follows:
- In step 2, we map the column containing the sync key (here sku = Product Reference) to the column containing the stocks (here qty = Quantity).
- We tick both columns to tell the tool to import them.
- By default, the "Processing" setting is left on "New value" which indicates to replace the quantities in the database by the values contained in the file:

In step 3, as usual, you need to choose the sync key correctly, here set to "Product reference":
- Choosing the synchro key
- We find our sku column mapped to references.
- And our qty column mapped to quantities.
- It's perfectly possible to update other data during the same operation, such as sales prices here:

If we import in this way, the file with reference 100733 will have a final quantity of 10.
Import by increase or decrease
We proceed in the same way, except for the "Processing" setting, which we'll set to Increase (1) to add quantities or Decrease (2) to subtract quantities:

Nothing changes in step 3, but please note the small + or - sign added to the right of the Quantity column heading, informing you of the update mode chosen: 
After importing these lines, if product reference 100733 previously had a stock of 30, it now has a stock of 20.
Category's other articles PrestaShop inventory management and mass publishing
-
Advanced inventory management module for PrestaShop 1.5, 1.6, and 1.7
How to
FAQ
Video
This article and video explain in detail how PrestaShop's advanced inventory management works and presents a much better advanced management alternative with the Merlin Backoffice bulk editing module
-
Prestashop inventory, inventory and stock management module
How to
Video
The Prestashop Merlin Backoffice mass management module includes a tool for creating physical inventory files. Quick search with barcode scanner, loss calculation...