ho-nl / magento2-reachdigital_storeresolver
ho-nl/magento2-reachdigital_storeresolver
Reach Digital Store Resolver
You are running a multi store with a specific catalog per domain.
Installation
composer require reach-digital/magento2-storeresolver
Automatic mapping from Domain > Store View
With the new implementation for the StoreResolverInterface the domains automatically get mapped to the correct store view. This reduces the need to modify code to get new domain names working.
- Register your domain
- Point the A-records to your server
Change index.php, .htaccess or nginx_config file to activate your domain nameStoreResolversolves this for you.
Add Store Code to Base URL
Store code will be removed from URL if added in the Base URL.
Make sure to explicitly set Base URL for Static View Files and Base URL for User Media Files without the store code
| Configuration | Value |
|---|---|
| Base URL | https://www.website.com/de/ |
| Base URL for Static View Files | https://www.website.com/static/ |
| Base URL for User Media Files | https://www.website.com/media/ |
It's not possible to have CMS pages with the same identifier as a store code!
Important note:
Base URLs which have no custom string set after the TLD, must be configured at website level, not on store level,
else matching on URL can result in multiple stores, see\Ho\StoreResolver\Model\StoreResolver::getAutoResolvedStore
Store scope definition
| Product | Default | Website | Store Group | Store View |
|---|---|---|---|---|
| Product prices | ✔ | ✔ | ||
| Product tax class | ✔ | ✔ | ||
| Product status | ✔ | ✔ | ||
| Product visibility | ✔ | ✔ | ✔ | |
| Product Inventory | ✔ | |||
| Product attributes / transl. | ✔ | ✔ | ✔ | |
| Base currency | ✔ | ✔ | ||
| (Default) display currency | ✔ | ✔ | ||
| Category settings | ✔ | ✔ | ||
| System configuration settings | ✔ | ✔ | ✔ | |
| Root category configuration | ✔ | |||
| Orders | ✔ | ✔ | ||
| Customers | ✔ | ✔ |
Known issues
Resolving URLs to stores
Store resolving may fail if configured secure/unsecure URLs differ, see \Ho\StoreResolver\Model\StoreUrls::getBaseUrls,
which only uses the unsecure base URL but should probably check the right one depending on Request::isSecure()
Change Log
All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog
and this project adheres to Semantic Versioning.
[1.0.2] - 2019-02-01
Note
- Added support for websites scope
- Add compatability for PHP 7.2
- Fix storeresolver when using multiple websites
- Add compatibility if storegroup has storeviews all with same url
[1.0.0] - 2017-02-03
Note
- Seperated Ho_Multistore and made StoreResolver into own module
[Unreleased]
| Version | Stability | QA Status | Compatibility | Released |
|---|---|---|---|---|
| 1.0.8 | stable | Fail | Magento 2.4.7 Details | 2025-01-31 09:07:17 |
| 1.0.7 | stable | Not tested | Not yet tested Details | 2024-01-15 14:59:26 |
| 1.0.6 | stable | Not tested | Not yet tested Details | 2023-06-20 07:19:32 |
| 1.0.5 | stable | Not tested | Not yet tested Details | 2022-12-27 14:32:54 |
| 1.0.4 | stable | Not tested | Not yet tested Details | 2022-08-05 12:51:52 |
| 1.0.3 | stable | Not tested | Not yet tested Details | 2021-07-14 06:42:03 |
| 1.0.2 | stable | Not tested | Not yet tested Details | 2021-06-09 12:28:20 |
| 1.0.1 | stable | Not tested | Not yet tested Details | 2021-06-08 14:05:09 |
| 1.0.0 | stable | Not tested | Not yet tested Details | 2021-06-04 10:15:56 |
| 0.9.0 | stable | Not tested | Not yet tested Details | 2021-06-04 10:05:37 |
Requires 1
| Package | Constraint |
|---|---|
| php | ~7.3.0||~7.4.0||~8.1.0||^8.2 |
Replaces 1
| Package | Constraint |
|---|---|
| honl/magento2-storeresolver | self.version |
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.
| Tool | Status | Findings | Summary |
|---|---|---|---|
| PHPCS | Fail | 28 | 11 errors, 17 warnings (ruleset: Magento2) — 3 auto-fixable with phpcbf |
| PHPMD | Warning | 13 | 13 rule violations (UnusedFormalParameter:8, MissingImport:3, IfStatementAssignment:1, UnusedLocalVariable:1) |
| Cpd | Pass | 0 | |
| Composer validate | Info | 2 | valid; 2 advisory notes (composer validate --strict) |
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 |
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.
No license declared
This package's composer.json doesn't declare a license, homepage, or authors. Check the source repository for terms of use.
More from ho-nl
View vendorTurn 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.