- dodano obsługę multi-store kompletną
Key features and benefits
- Bulk quantity updates: change stock levels for many items from a single file, without manually editing each product page.
- Separate modes for products and combinations: update products without variants or stock levels of specific variants, with recalculation of their total at the product level.
- Matching by catalog codes: reference, i.e. SKU, EAN13, UPC, product ID, combination ID, and MPN, if the relevant field is available in the installation.
- Supplier column mapping: indicate the identifier and quantity columns, ignore additional data, and use a mapping suggestion based on recognized headers.
- Setting or adding quantities: use a full stock listing or a file containing quantities to add, for example from a delivery.
- Including open orders: optionally subtract quantities from orders with selected statuses before applying values from the file.
- Simulation before saving: check matches, planned changes, and reasons for skipping items without changing stock levels in the catalog.
- Configurable limits: control percentage increases and decreases in quantity, stock zeroing, and the share of rows with no match in the store.
- Handling negative results: choose between saving a negative value, raising it to zero, or skipping the item.
- CSV report and differences screen: quantities before and after the operation, difference, identifiers, and the decision for a given row; filters and report pagination are available in the panel.
- History and quantity restore: access run history and revert saved changes if a stock snapshot from before the import was preserved.
- Export of current stock levels: CSV file for products or combinations with selection of store, identifier, and separator, taking saved column mapping into account.
- Downloading from the supplier and settings profiles: import files from an HTTP/HTTPS address or an FTP/FTPS server and save configurations used for different data sources.
- Support for recurring updates: address for an external CRON, preview of the result of the last call, and continuation of a started import.
- Step-by-step processing of larger files: progress bar and the ability to continue from the panel, also using a button when JavaScript is disabled.
- Identifier index control: information about a missing database index and a tool to add it, helpful when matching items in a larger catalog.
- Email summary: optional message after the update is completed, with the report as an attachment when its size allows it.
How does the stock update for products and variants work?
Product mode is used to update items without combinations. A product that has combinations is skipped in this mode and receives an appropriate entry in the report. To change variant quantities, select combination mode and match the identifiers from the file to the correct variants. After saving, the module recalculates the total product stock as the sum of the quantities of its combinations.
- Set stock: if the store has 10 units and the file contains 25, the new stock level will be 25 units.
- Add to stock: with 10 units in the store and a value of 25 in the file, the result will be 35 units.
- Subtract open orders: in set mode, with a value of 25 in the file and 4 units in orders covered by the selected statuses, the result will be 21 units.
The examples assume correct matching and no blocking by limits; in the first two, order subtraction is disabled. The subtraction option uses orders from the target store and does not support matching by MPN. With shared catalog codes, you can update the first match or all matched items.
CSV file from the warehouse or wholesaler
The basic layout contains an identifier and a quantity. You can set the separator, including a tab, specify whether a header is present, and assign other column positions. The data preview makes it easier to verify the mapping, and a suggestion recognized from headers requires confirmation. The file should be prepared in UTF-8; the reader removes the BOM marker and supports fields in quotation marks.
Example for a semicolon separator, identification by reference, and header skipping enabled:
code;quantity
SKU-001;25
SKU-002;0
SKU-003;8
Quantities are saved as integers. A value of 3,9 or 3.9 will be read as 3, and -3,9 as -3. Empty or non-numeric values are skipped with information in the report. A valid value of 0 means a proposal to set zero in stock-setting mode and is still subject to the configured limits.
Change control and import rollback
Simulation is enabled by default in the update launch form. Limits allow you to skip a blocked item or reject the import after analysis performed before saving. Percentage increase and decrease are evaluated against the positive stock level currently existing in the store. A separate threshold can stop the import when the share of correctly read rows without a useful match in the store reaches the configured value.
The report shows decisions regarding the data, and the history stores information about the file, store, mode, and run results. With snapshot saving enabled, the restore function recreates previous quantities for items covered by the snapshot. The number of preserved runs can be configured; by default, it is 10. Restoring writes the quantities from before the import, so it may overwrite later changes resulting from orders, manual edits, or subsequent updates.
File downloading and automatic stock updates
The file can be uploaded manually or downloaded from a public HTTP/HTTPS address or an FTP/FTPS server. SFTP is available if it is supported by the cURL library on the store server. Downloading requires the cURL extension and a source available at a public address; private network addresses are rejected.
After automation is enabled, the module provides an address secured with a secret token. The call frequency is set in an external CRON schedule. The next call continues an active import; if no run has been started, you can download a new file and perform the update, only download the file, or start importing an already saved file. Status checking is also available.
Supplier profiles save, among other things, the separator, mapping, identifier, quantity mode, limits, and download source. They are stored separately for the target store. They do not include the supplier password or the CRON token, so changing a profile requires checking the current password in the automation settings.
Working in multistore and the module scope
- Store selection: import and export have a target store setting. If a store group shares stock, the update applies to its shared resource, which also affects the other stores using those quantities. The current module settings are shared across the installation.
- Updating the existing catalog: the module does not create products or combinations and does not import prices, descriptions, images, or new identification codes. There is no function for automatically zeroing all items not present in the file.
- File format and size: CSV files and TXT files with a CSV structure are accepted, without direct XLSX or XML import. The module limit is 32 MiB; the manual upload limit may be lower due to server settings.
- Continuing work: with step-by-step import started in the panel, subsequent steps require the page to remain open, manual continuation, or CRON calls. Closing the tab does not start a separate background process.
- Cooperation with stock add-ons: batch saving does not trigger the
actionUpdateQuantityhook and does not createstock_mvtstock movement entries. Add-ons that require these events need separate compatibility verification. - Declared compatibility for version 2.0.0: PrestaShop from 1.7.6.0 to the 9.x series; the module documentation indicates PHP 7.0–8.5. The PHP version must also meet the requirements of the PrestaShop version in use.
Workflow with the module
- Select the store, update type, identifier, and the method of applying quantities.
- Upload or download the file, check the separator and header, then save the column mapping.
- Set limits, snapshot saving, and optionally subtract quantities from selected order statuses.
- Run the simulation and review the summary and the differences report.
- After verifying the data, run the update with simulation disabled, and check the result in the history.
Link to the module demo:
Admin panel demo:
https://moduly-prestashop.eu/csvquantityupd/admin-dev
Front office demo:
https://moduly-prestashop.eu/csvquantityupd