21/10/2023 Franck Bugnet How to

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:

  1. In step 2, we map the column containing the sync key (here sku = Product Reference) to the column containing the stocks (here qty = Quantity).
  2. We tick both columns to tell the tool to import them.
  3. 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:


Inventory update by import

In step 3, as usual, you need to choose the sync key correctly, here set to "Product reference":

  1. Choosing the synchro key
  2. We find our sku column mapped to references.
  3. And our qty column mapped to quantities.
  4. It's perfectly possible to update other data during the same operation, such as sales prices here:


Import step 3


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:


Decrease or increase inventory via file import

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:
Step 3 of import in "decrease quantities" mode

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

Settings
  • Login
    • £ GBP
    • $ USD
Menu