etechflow / module-mega-menu
etechflow/module-mega-menu
Theme-agnostic mega menu for Magento 2. Renders on Hyvä, Luma, Adobe Commerce default and custom themes via automatic runtime detection. Provides a JSON endpoint for lazy-loaded subcategory + featured-product data.
Etechflow_MegaMenu
A theme-agnostic mega menu for Magento 2.
At a glance
- Themes supported: Hyvä, Luma, Adobe Commerce default, and any custom theme inheriting from either.
- No jQuery dependency in the Luma variant — uses vanilla JS only, so it stays light and works in lean themes.
- No Knockout / RequireJS in the Hyvä variant — uses Alpine.js (already shipped with every Hyvä theme).
- Lazy-loaded data: dropdown subcategories + featured products are fetched on first hover from a 1-hour-cached JSON endpoint (
/megamenu/products/index?cat=<id>). - Auto theme detection at runtime — picks the right template per request.
Quick install
# from your Magento root
cp -r /path/to/Etechflow_MegaMenu app/code/Etechflow/MegaMenu
bin/magento module:enable Etechflow_MegaMenu
bin/magento setup:upgrade
bin/magento setup:di:compile
bin/magento setup:static-content:deploy -f
bin/magento cache:flush
See the top-level INSTALL.md in the distribution ZIP for full instructions (3 install methods, production-mode notes, troubleshooting).
Where to configure
Stores → Configuration → eTechFlow → Mega Menu:
- Master enable/disable
- Root Category ID (which category's children become the top-level menu items)
- Attach All Active Categories — Yes = every active category & sub-category auto-shows on enable, even ones set to "Include in Menu = No". No (default) = respect each category's flag. (Categories attach automatically either way — this just controls hidden ones.)
- Custom Menu Links — add your own top-level items (Label + URL/path + Sort). They merge in after the category items. Lets admins add custom links without touching categories.
- Max depth, featured products per category, mobile drill-down toggle, cache TTL
- Featured Products Source — choose what fills each dropdown's product column:
Category Position (default) / Newest / Best Sellers / On Sale / Price Low→High / Price High→Low - Dropdown Promo CMS Block — optional CMS block identifier rendered as a banner/column
inside every dropdown (Content → Blocks). Leave blank for none.
Files
Etechflow_MegaMenu/
├── composer.json
├── registration.php
├── etc/ # module.xml, config.xml, acl.xml, routes.xml, system.xml, di.xml
├── Controller/ # JSON endpoint (megamenu/products/index)
├── Block/ # MegaMenu renderer (picks template by theme)
├── ViewModel/ # MenuData — top-level categories + theme detection
├── Model/Config.php # Typed config reader
├── view/frontend/ # Layout, both phtml variants, CSS, vanilla JS
└── i18n/en_US.csv
Override points
- Template: drop your own
mega-menu.phtml(ormega-menu-luma.phtml) under
app/design/frontend/<Vendor>/<theme>/Etechflow_MegaMenu/templates/. - CSS: override
mega-menu.cssthe same way. - Block: subclass
Etechflow\MegaMenu\Block\MegaMenuand rebind via your theme'sdi.xml. - Data: subclass
ViewModel\MenuDatafor custom queries or pre-baked menus.
Public route
GET /megamenu/products/index?cat=<id> → JSON:
{
"subcategories": [{"id":3,"name":"Range Rover","url":"https://…","count":42}, …],
"products": [{"name":"…","price":29.99,"price_formatted":"£29.99","url":"…","img":"…"}, …]
}
License
MIT — see LICENSE.md in the distribution.
No changelog yet
The vendor hasn't published a changelog. Tagged releases appear in the Versions tab.
Requires 6
| Package | Constraint |
|---|---|
| magento/framework | >=103.0 |
| magento/module-catalog | >=104.0 |
| magento/module-config | >=101.0 |
| magento/module-store | >=101.0 |
| magento/module-theme | >=101.0 |
| php | >=8.1 |
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 | 110 | 16 errors, 94 warnings (ruleset: Magento2) — 47 auto-fixable with phpcbf |
| PHPMD | Warning | 8 | 8 rule violations (NPathComplexity:3, MissingImport:2, CyclomaticComplexity:1, ExcessiveMethodLength:1, ErrorControlOperator:1) |
| Cpd | Pass | 0 | |
| Composer validate | Info | 6 | valid; 6 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 |
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.
More from etechflow
View vendorDynamic 'View Other Options/Finishes/Sizes' PDP buttons driven by per-product link attributes; replaces hardcoded in-description buttons and strips the old ones at render time.
EtechFlow Store Locator — admin-managed store/branch finder for Magento 2 with a Leaflet + OpenStreetMap map and postcode proximity search (postcodes.io). Hyva and Luma compatible. No paid map API key required.
Universal Product Fitment Finder for Magento 2 — Make/Model/Year/Part filtering on any fitment domain (automotive, motorcycle, marine, RV, phone cases, watches, appliance parts, anywhere a customer asks "will this fit my X?"). Admin-configurable labels + URL prefix so the same module rebrands to any merchant domain. Includes PDP fitment badge, SEO URLs, customer garage with cross-device sync, OEM/part-number search, and admin tooltips throughout. Theme-agnostic — Hyvä, Luma, custom themes. Renamed from "module-vehicle-compat" in v2.0.0.
Help-Centre / FAQ module for Magento 2 with categories, slug-based detail pages, search, related articles, REST API, and admin management. Theme-agnostic — works on Hyvä, Luma, and any custom theme.
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.