Update products with 0 stock when Import via CSV

In many cases CSV want to update the stock of products by the importer PrestaShop. The problem usually arises when we want to update products or combinations with the value "0". PrestaShop prevents actualizemos amounts to "0", so we have to resort to a modification to update us products with the value of stock.

We'll have to open the "controllers/admin/AdminImportController.php" file

Seek public function productImport function (), and within it, this line

and eliminate the section "&& (int) $ product-> quantity"

With this we can update products with stock 0 from our CSV

But if we update product combinations, we need to modify another line in the same file. Within the attributeImport (function), we seek:

and replaced by:


With this, we should update products with stock "0".

We can also create an override of the class AdminImportController.php not lose it when you upgrade.

Product added to wishlist
Product added to compare.

We use a selection of our own and third-party cookies on the pages of this website: Essential cookies, which are required in order to use the website; functional cookies, which provide better easy of use when using the website; performance cookies, which we use to generate aggregated data on website use and statistics; and marketing cookies, which are used to display relevant content and advertising. If you choose "ACCEPT ALL", you consent to the use of all cookies. You can accept and reject individual cookie types and revoke your consent for the future at any time under "Settings".