# honl/magento2-import

`composer require honl/magento2-import`

Canonical URL: https://packagento.com/honl/magento2-import

## At a glance

- **Vendor**: honl (https://packagento.com/honl.md)
- **Latest version**: 1.4.1 — released 2026-05-29
- **Pricing**: Free
- **Package type**: Magento 2 module
- **Status**: active, accepting new buyers

## Installation

Packagento is licence-gated, so even free packages need a licence on a project before Composer can resolve them.

1. **Sign in or create an account** at https://packagento.com/customer/account/.

2. **Add the package to your account.** Open https://packagento.com/honl/magento2-import and complete the free checkout. A licence is minted automatically.

3. **Create or pick a project, then activate the licence on it.**
   - Projects represent the Magento installs you deploy to. Manage them at https://packagento.com/projects/.
   - Activate the new licence on the project you'll deploy this package to. Activation is what generates the Composer credentials scoped to that project.

4. **Add the project credentials to your Magento codebase.**

   Grab the project's public + private key from https://packagento.com/projects/ (open the project, then its Credentials tab), and add them to `auth.json`:

   ```json
   {
     "http-basic": {
       "packagento.com": {
         "username": "ppk_live_...",
         "password": "psk_live_..."
       }
     }
   }
   ```

   Add the Packagento Composer repository to `composer.json`:

   ```json
   {
     "repositories": [
       { "type": "composer", "url": "https://packagento.com" }
     ]
   }
   ```

5. **Install and apply.**

   ```bash
   composer require honl/magento2-import:*
   bin/magento setup:upgrade
   bin/magento setup:di:compile
   bin/magento cache:flush
   ```

## README

Import library to create an array-interface for importing products/categories. Ho_Import is build on top
of Magento's internal Import/Export modules.

The goal of the library is to be a swiss army knife for importing products in Magento 2. Features include:

- Stream XML over HTTP and from disk
- Download files from HTTP(s)/FTP
- Map items from source file to Magento format
- Lot's of [RowModifiers](https://github.com/ho-nl/magento2-Ho_Import/tree/master/src/RowModifier)
- Fixed importer core bugs

[ExampleProfile.php](src/docs/examples/basic/ExampleProfile.php)

### Installation

```BASH
composer config repositories.honl/magento2-import vcs git@github.com:ho-nl/magento2-Ho_Import.git
composer require honl/magento2-import
```

### Goals
Performance: Since building imports is (really) hard and requires a lot of feedback loops to get your data right (change, check, change, check), it is absolutely essential that is as fast as possible. A developer can't work if he has to wait 10 minutes after each change. So only having to wait only a few seconds to be able to see what is going into Magento is essential.

Ease of use: The API should be clear that a developer is only limited by their knowledge of Magento it's self. No junior developer should have to thing about streaming files, performance and memory usage.

Extensible: It should be very easy to extend and customize a import

Maintainable: The library should have a stable API (currently not stable yet) so that we can upgrade imports that are build a year ago without having to worry that everything will break.


### Getting the abstraction right
With Ho_Import for Magento 1, we created a [custom DSL](https://github.com/ho-nl/magento1-Ho_Import/blob/master/docs/imports/product_multiple_sources.xml#L39-L209) to map external files to a Magento compatible format. This worked, but we soon discovered that we needed a lot of basic PHP functionality in the importer. We caught ourselves implementing PHP functionality in Ho_Import compatible wrappers...

The alternative was working bare with [Avs_FastSimpleImport](https://github.com/avstudnitz/AvS_FastSimpleImport) gave no abstraction other than, 'you can fill this array'. Although this was a huge leap forward from 'create your own csv file', it didn't offer any tools to make building imports easier more robust and faster.

Now, writing a new import library for Magento 2 and having to start from scratch, it was a good moment to create a new abstraction. Assuming that people who need to build imports at least know the basics of Magento 2 programming we can create an import that doesn't rely on 'nice abstractions', but does offer the tools to get an import quickly up and running.

1. Create a single class file to create a fully functional import. If the class is too complex, the developer can decide to spit the logic them selves.
2. Use RowModifiers to modify data and make it easy for other developers to create new

The core concept of the new import library is based around RowModifiers.

#### What are RowModifiers?
A `RowModifier` can update items, add items, delete items, add new values, rewrite values, validate rows, etc.

Example usage of the `\Ho\Import\RowModifier\ItemMapper`

```PHP
$items = [ ... ]; //Array of all products

/** @var \Ho\Import\RowModifier\ItemMapper $itemMapper */
$itemMapper = $this->itemMapperFactory->create([
    'mapping' => [
        'store_view_code' => \Ho\Import\RowModifier\ItemMapper::FIELD_EMPTY,
        'sku' => function ($item) {
             return $item['ItemCode'];
         }
        'name' => function ($item) {
            return $item['NameField'] . $item['ColorCode'];
        }
    ]
]);
$itemMapper->setItems($items);
$itemMapper->process($items); //The items array is modified with new values.
```


RowModifies all inherit from `\Ho\Import\RowModifier\AbstractRowModifier`



### General Assumptions

- People writing imports are programmers or at least have basic programming knowledge.
- Magento's importer is limited and certainly doesn't *Just Work(tm)*, we need to build abstractions on top to be able to actually focus on the import instead of all the 'stuff' that comes with an import.

### Technical assumptions
- PHP's array format is memory efficient enough that it can hold all products needing to be imported in memory. e.g. 50k products requires more memory, but is usually ran on a beefy server.
-



### Contibutors

Here at H&O we've created many imports for clients, we have exstenbuild Ho_Import, core contributor to Avs_FastSimpleImport



that mapped source files to Magento compatible formats, but was never
intended to solve problems with url rewrites, creating configurables. All that functionality


This library builds on top of Magento's internal Import/Export module

### Console commands

#### `ho:import:run profileName`

Run an import script directly (not recommended on live environments, might cause deadlocks).

#### `cron:schedule jobName`

Schedule a job to run immediately.


### Credits	
The module is written by Paul Hachmang (twitter: [@paales](https://twitter.com/paales), email: paul@reachdigital.nl) and build for Reach Digital. We make [Magento Webshops](https://www.reachdigital.nl/) (website: <https://www.reachdigital.nl/>, email: <info@reachdigital.nl>, twitter: [@ho_nl](https://twitter.com/ho_nl)).

## Recent Versions

| Version | Released |
|---|---|
| 1.4.1 | 2026-05-29 |
| 1.4.0 | 2026-05-29 |
| 1.3.9 | 2026-05-05 |
| 1.3.8 | 2026-04-29 |
| 1.3.7 | 2026-04-29 |
| 1.3.6 | 2025-11-20 |
| 1.3.5 | 2024-10-23 |
| 1.3.4 | 2023-08-30 |
| 1.3.3 | 2023-08-15 |
| 1.3.2 | 2023-06-20 |

Showing 10 of 23 versions. Full release history on https://packagento.com/honl/magento2-import.

## Dependencies

### Require

| Package | Constraint |
|---|---|
| ext-mbstring | * |
| guzzlehttp/guzzle | ^7 |
| ho-nl-fork/magento-psr6-bridge | ^0.2 |
| ho-nl-fork/psr7-csv-factory | ^1.0 |
| kevinrob/guzzle-cache-middleware | ^4 |
| league/csv | ^9.1 |
| monolog/monolog | ^2.8 \|\| ^3.0 |
| php | ~7.1.0 \|\| ~7.2.0 \|\| ~7.3.0 \|\| ~7.4.0 \|\| ~8.1 \|\| ~8.2 \|\| ~8.3 \|\| ~8.4 |
| prewk/xml-string-streamer | ^1.2 |
| prewk/xml-string-streamer-guzzle | ^1.2 |
| symfony/stopwatch | ^6.2 \|\| ^7.0 |

### Suggest

| Package | Constraint |
|---|---|
| openspout/openspout | Required for Ho\Import\Streamer\FileXlsx — streaming XLSX reader (PHP 8.3+). Install via `composer require openspout/openspout`. |

## Quality

Latest release (1.4.1) fails the Packagento QA pipeline. Verdicts below are per-cell (Magento line × PHP version) for the matrixed tools, and run-once for the static / security tiers.


### Compatibility

Each Magento line is installed on its supported PHP versions, then the module is built (DI compile + static-content deploy). Cells show passed / failed / untested; staircase gaps render as `–`.

| Magento | PHP 8.2 | PHP 8.3 | PHP 8.4 | PHP 8.5 |
|---|---|---|---|---|
| 2.4.7 | Pass | Pass | – | – |
| 2.4.8 | – | 1 | not tested | – |
| 2.4.9 | – | – | not tested | not tested |


### Code Quality

Advisory checks against the module's source. Never affect the Compatibility verdict — a phpcs finding can't make a module incompatible.

#### Static Analysis

Coding standards (phpcs), mess detection (phpmd), copy-pasted code (cpd), PHP cross-version compatibility, composer.json validity. Each runs once for the whole module.

| Tool | Status | Findings | Summary |
|---|---|---|---|
| PHPCS | Fail | 184 | 12 errors, 172 warnings (ruleset: Magento2) — 57 auto-fixable with phpcbf |
| PHPMD | Warning | 49 | 49 rule violations (MissingImport:21, UnusedFormalParameter:5, CyclomaticComplexity:5, NPathComplexity:4, IfStatementAssignment:3) |
| Cpd | Warning | 1 | 1 duplicated chunk spanning 95 total lines (min-lines=5, min-tokens=70) |
| Composer validate | Info | 1 | valid; 1 advisory note (composer validate --strict) |

#### PHPStan

Type-checks the module against a real Magento install. Re-runs per Magento + PHP version because resolvable symbols differ between releases.

| Magento | PHP 8.2 | PHP 8.3 | PHP 8.4 | PHP 8.5 |
|---|---|---|---|---|
| 2.4.7 | 1 | 1 | – | – |
| 2.4.8 | – | 1 | 1 | – |
| 2.4.9 | – | – | 1 | 1 |


### Tests

Unit and integration suites run per Magento + PHP cell. Test failures speak to the module's behaviour, not its compatibility with a line, so they're reported here separately.

#### Unit Tests

| Magento | PHP 8.2 | PHP 8.3 | PHP 8.4 | PHP 8.5 |
|---|---|---|---|---|
| 2.4.7 | N/A | N/A | – | – |
| 2.4.8 | – | N/A | N/A | – |
| 2.4.9 | – | – | N/A | N/A |

#### Integration Tests

| Magento | PHP 8.2 | PHP 8.3 | PHP 8.4 | PHP 8.5 |
|---|---|---|---|---|
| 2.4.7 | N/A | N/A | – | – |
| 2.4.8 | – | N/A | N/A | – |
| 2.4.9 | – | – | N/A | N/A |


### Security

Dependency-advisory audit (composer audit) plus a source malware scan. A malware detection fails the version outright.

| Tool | Status | Findings | Summary |
|---|---|---|---|
| Composer audit | Pass | 0 |  |
| Malware scan | Pass | 0 |  |

## Licence and pricing

Free. A licence is still minted on checkout and bound to your project for Composer access — no payment step.

Refundable within 14 days of first purchase via https://packagento.com/account/refunds/.

## Install via Claude Code or any MCP client

The Packagento MCP server can run the licence + project + Composer steps above in one tool call:

```
purchase_and_install_packages(
  composer_names=["honl/magento2-import"],
  project_id="proj_xxx"
)
```

This handles cart, checkout, licence minting, project activation, and writes auth.json credentials. Connect a client with `claude mcp add packagento https://mcp.packagento.com`. Full setup at https://packagento.com/docs/mcp-setup.

## Vendor

honl is a Magento 2 vendor on Packagento. See https://packagento.com/honl.md for their full catalogue.

