ecomdev / magento2-product-data-preloader
ecomdev/magento2-product-data-preloader
Magento 2 Product Data Pre-Loader FTW
Product Data Pre-Loader
Magento platform code and third-party extensions in a lot of cases produce redundant database queries on product collections load.
This module provides an easy way to pre-load data for product collections like prices, stock data, and many more by using different types of load types.
Right now it supports 3 types of loaded product collections:
listProducts that are using price index in selection, so it is safe to use stale index data for data loadercartProducts that are used to calculate customers shopping cart and require accurate data to be loaded from databaseotherProducts that are not falling into any of the above categories
In order to pre-load data for a product collection, you need to implement EcomDev\ProductDataPreLoader\DataService\DataLoader interface with such methods:
isApplicable(string $type): boolmethod that is used to decide if your loader compatible with specific product collection type.load(ScopeFilter $filter, ProductWrapper[] $products): arraymethod that preloads data intoLoadServicethat can be used later to access data by your loader id.
Custom loaders should be added to LoadService object via DI configuration like this:
<type name="EcomDev\ProductDataPreLoader\DataService\LoadService">
<arguments>
<argument name="loaders" xsi:type="array">
<item name="my_custom_loader" xsi:type="object">My\Module\Loader\MyCustomLoader</item>
</argument>
</arguments>
</type>
Installation
Given EOL of Composer 1 all new packagist packages are not published for some time. So best way to keep your install up-to-date is to use Composer 2.0.
composer require ecomdev/magento2-product-data-preloader
No changelog yet
The vendor hasn't published a changelog. Tagged releases appear in the Versions tab.
Requires 5
| Package | Constraint |
|---|---|
| magento/framework | * |
| magento/module-catalog | ~103.0|~104.0 |
| magento/module-quote | ~101.0 |
| magento/module-customer | ~102.0|~103.0 |
| php | ~7.2|~8.0 |
Requires-dev 4
| Package | Constraint |
|---|---|
| phpstan/phpstan | ^0.12.86 |
| squizlabs/php_codesniffer | ^3.6.0 |
| phpunit/phpunit | ~9.5 |
| ecomdev/magento2-test-essentials | dev-main |
Compatibility
Each Magento release line is installed on its supported PHP versions, then the module is built (DI compilation + static-content deploy) and its unit and integration suites are run. The matrix shows the lines and PHP versions the module is confirmed to install and run on. Code-quality results further down (phpstan, phpcs, …) are reported separately and never affect compatibility.
Code Quality
Advisory checks against the module's source. Static analysis runs once across the whole module; PHPStan re-runs per Magento + PHP version because resolvable symbols differ between releases. These NEVER affect the Compatibility badge — 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.
PHPStan
Type-checks the module's PHP against a real Magento install at the configured gate level. Re-runs per Magento and PHP version because resolvable symbols differ between releases. Cell → details modal.
Tests
Unit and integration suites, run for each applicable Magento and PHP version. A test failure speaks to the module's behaviour, not its compatibility with a Magento line, so it is reported here separately and never reddens the compatibility matrix.
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
Security checks run directly against the module: an audit of its declared dependencies for known vulnerabilities (composer audit) and a scan of its source for malware and web-shell signatures. Each runs once. A malware detection fails the version outright.
Turn an existing module into recurring revenue.
If you already maintain a Magento 2 module on GitHub or GitLab, listing it on Packagento takes about five minutes. We mirror your tags, handle distribution signing, and route paid licenses through Stripe Connect, so you can keep shipping the way you already do.