PHPackages                             actualizer/stock-importer - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [File &amp; Storage](/categories/file-storage)
4. /
5. actualizer/stock-importer

ActiveShopware-platform-plugin[File &amp; Storage](/categories/file-storage)

actualizer/stock-importer
=========================

Import stock levels from CSV files

1.0.5(3w ago)00MITPHPPHP &gt;=8.4

Since May 31Pushed 3w ago1 watchersCompare

[ Source](https://github.com/actualizer/ActStockImporter)[ Packagist](https://packagist.org/packages/actualizer/stock-importer)[ RSS](/packages/actualizer-stock-importer/feed)WikiDiscussions main Synced 1w ago

READMEChangelog (3)Dependencies (4)Versions (6)Used By (0)

ActStockImporter - Shopware Plugin
==================================

[](#actstockimporter---shopware-plugin)

A Shopware 6 plugin that automatically imports stock levels from CSV files, supporting both local file processing and SFTP integration for automated stock management.

Features
--------

[](#features)

- Import stock levels from CSV files
- Support for both local directory and SFTP server as data source
- Scheduled automatic imports with configurable intervals
- Manual import via console command
- Product activation/deactivation based on stock status
- Two stock update methods: absolute and normal
- Automatic file backup with configurable retention
- Stock aggregation for duplicate product numbers
- Comprehensive logging and error handling
- Compatible with Shopware 6.7

Requirements
------------

[](#requirements)

- Shopware 6.7 or higher
- PHP 8.4 or higher
- phpseclib/phpseclib ^3.0 (for SFTP functionality)

Installation
------------

[](#installation)

1. Download or clone this plugin into your `custom/plugins/` directory
2. Install and activate the plugin via CLI: ```
    bin/console plugin:refresh
    bin/console plugin:install --activate ActStockImporter
    bin/console cache:clear
    ```

Configuration
-------------

[](#configuration)

1. Go to Admin Panel → Settings → System → Plugins
2. Find "Actualize: Stock Importer" and click on the three dots
3. Click "Config" to access plugin settings

### Configuration Options

[](#configuration-options)

- **Import Method**: Choose between local directory or SFTP server
- **Stock Update Method**:
    - `normal`: Updates only stock field
    - `absolute`: Updates both stock and availableStock fields
- **Scheduled Import**: Enable/disable automatic imports
- **Import Interval**: Set interval in minutes for automatic imports
- **Backup Retention**: Number of days to keep backup files
- **SFTP Settings** (if using SFTP method):
    - Host, Port, Username, Password
    - Remote directory path

CSV File Format
---------------

[](#csv-file-format)

The plugin expects CSV files with semicolon (`;`) as delimiter and the following structure:

```
Product Number;Stock;Active
ABC-123;50;1
XYZ-456;0;0
DEF-789;25;1
```

**Columns:**

- `Product Number`: The product's article number in Shopware
- `Stock`: Stock quantity (integer)
- `Active`: Product activation status (1 = active, 0 = inactive)

How it works
------------

[](#how-it-works)

### Local Directory Method

[](#local-directory-method)

1. **File Placement**: Place CSV files in the `_act_stockimporter` directory in your project root
2. **Processing**: Files are processed in order of modification time (oldest first)
3. **Backup**: Processed files are moved to `_act_stockimporter/backup` with timestamp prefix
4. **Cleanup**: Old backup files are automatically deleted based on retention settings

### SFTP Method

[](#sftp-method)

1. **File Download**: Plugin connects to SFTP server and downloads CSV files
2. **Processing**: Downloaded files are processed locally
3. **Cleanup**: Files are deleted from SFTP server after successful download
4. **Backup**: Same local backup process as directory method

### Stock Processing

[](#stock-processing)

1. **Aggregation**: If multiple rows exist for the same product number, stock quantities are summed
2. **Activation**: If any row for a product is marked as active, the product remains active
3. **Update**: Products are updated with new stock levels and activation status
4. **Logging**: All operations are logged with detailed information

Manual Import
-------------

[](#manual-import)

You can trigger imports manually using the console command:

```
bin/console act:stock:import
```

Technical Details
-----------------

[](#technical-details)

### Events and Scheduling

[](#events-and-scheduling)

- Uses Shopware's scheduled task system for automatic imports
- Task interval is dynamically configurable through admin settings
- Supports both immediate execution and scheduled processing

### File Processing

[](#file-processing)

- CSV parsing with semicolon delimiter
- Automatic header row detection and skipping
- Error handling for malformed files
- Support for different file encodings

### Stock Update Methods

[](#stock-update-methods)

- **Normal**: Updates only the `stock` field
- **Absolute**: Updates both `stock` and `availableStock` fields for complete inventory control

### Backup and Retention

[](#backup-and-retention)

- Automatic backup of processed files with timestamp
- Configurable retention period (default: 30 days)
- Automatic cleanup of old backup files

Development
-----------

[](#development)

### Building/Testing

[](#buildingtesting)

After making changes:

```
bin/console cache:clear
bin/console scheduled-task:run
```

### Debugging

[](#debugging)

- Check log files for import operations and errors
- Enable Shopware's debug mode for detailed error information
- Use the manual import command for testing

Example Usage
-------------

[](#example-usage)

1. **Local Directory Setup**:

    - Enable local directory import method
    - Place CSV files in `_act_stockimporter/`
    - Files are processed automatically or manually
2. **SFTP Integration**:

    - Configure SFTP connection details
    - Set up automated file upload to SFTP server
    - Plugin downloads and processes files automatically
3. **Scheduled Processing**:

    - Enable scheduled imports
    - Set appropriate interval (e.g., 5 minutes)
    - Monitor logs for successful operations

Compatibility
-------------

[](#compatibility)

- **Shopware Version**: 6.7
- **PHP Version**: 8.4+
- **Dependencies**: phpseclib/phpseclib ^3.0
- **Template Compatibility**: Uses Shopware 6.7 plugin structure

Support
-------

[](#support)

For issues and feature requests, please use the GitHub issue tracker.

License
-------

[](#license)

This plugin is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.

Credits
-------

[](#credits)

Developed by Actualize

---

Made with ❤️ for the Shopware Community

###  Health Score

41

—

FairBetter than 87% of packages

Maintenance94

Actively maintained with recent releases

Popularity0

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity55

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~7 days

Total

5

Last Release

26d ago

PHP version history (2 changes)1.0.1PHP &gt;=8.3

1.0.4PHP &gt;=8.4

### Community

Maintainers

![](https://www.gravatar.com/avatar/c4299bac39069091458750da888ec6ed88b1898143fc8d95f468a05d19a6c57e?d=identicon)[actualizer](/maintainers/actualizer)

---

Top Contributors

[![actualizer](https://avatars.githubusercontent.com/u/17499933?v=4)](https://github.com/actualizer "actualizer (11 commits)")

---

Tags

shopware6shopware6-pluginshopware6-pluginssw6sw6-plugin

### Embed Badge

![Health badge](/badges/actualizer-stock-importer/health.svg)

```
[![Health](https://phpackages.com/badges/actualizer-stock-importer/health.svg)](https://phpackages.com/packages/actualizer-stock-importer)
```

###  Alternatives

[leantime/leantime

Open source project management system for non-project managers. Simple like Trello, powerful like Jira. Built with neurodiversity in mind.

10.2k4.0k](/packages/leantime-leantime)[shopware/administration

Administration frontend for the Shopware Core

414.3M119](/packages/shopware-administration)[civicrm/civicrm-core

Open source constituent relationship management for non-profits, NGOs and advocacy organizations.

751291.4k46](/packages/civicrm-civicrm-core)[league/flysystem-sftp-v3

SFTP filesystem adapter for Flysystem.

6134.8M164](/packages/league-flysystem-sftp-v3)[shopware/storefront

Storefront for Shopware

674.6M247](/packages/shopware-storefront)[shopware/core

Shopware platform is the core for all Shopware ecommerce products.

585.6M600](/packages/shopware-core)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
