etechflow / module-product-warning

etechflow/module-product-warning

Per-product and per-category warning banners on the Magento 2 PDP. Admin can write coloured notices, assign them to specific products or whole categories, and the storefront auto-renders them. Theme-agnostic — works on Hyvä, Luma, and any custom theme without template overrides.

magento2-module Compatibility: Not yet tested Code Quality: Pending Tests: N/A Security: Pending proprietary
Viewing version 1.0.1. Latest version is 1.1.5. Switch to latest

Etechflow_ProductWarning — Product Warning Banners for Magento 2

Per-product and per-category warning banners on the storefront PDP. Admin can create coloured notices ("This item ships from a remote warehouse", "Cutting service unavailable for this key", "Backorder — 7 day lead time", etc.), assign them to specific products or whole categories, and the storefront auto-renders them above the price.

  • Version: 1.0.0
  • Package: etechflow/module-product-warning
  • Magento: 2.4.4 – 2.4.8 (newer versions should work; report incompatibilities)
  • PHP: 8.1, 8.2, 8.3
  • License: proprietary (LICENSE.txt) — Commercial licenses available at https://etechflow.com
  • Vendor: ETechFlow — https://etechflow.com

What you get

  • Admin grid + edit form under Catalog → Inventory Warning
    • Warning name (admin-only label)
    • Warning message (customer-facing text)
    • Color (hex picker, used for the banner tint + left border)
    • Active toggle, sort order
    • Assigned categories (multi-tree picker — assigns to every product in those categories)
    • Assigned products (search + multi-select picker)
  • Storefront PDP rendering (auto-injected via this module's own layout XML — no theme override required)
    • Stacks multiple warnings if a product matches several
    • Tints background + border using the warning's color
    • Scoped CSS namespace (.epw-*) — won't collide with theme classes
  • Resolver model (ETechFlow\ProductWarning\Model\WarningResolver::getForProduct($product)) for stores that want to render warnings in a custom location (e.g., listing pages, cart, emails)
  • Demo data installer seeds 3 example warnings on first install (toggle-able by deleting the patch row)
  • Theme-agnostic by design — works on Hyvä, Luma, Mage-OS adminhtml, and any custom theme

Theme compatibility

Theme Status
Magento 2 default (Luma / Blank) ✅ Works — vanilla CSS, no Knockout dependency
Hyvä Theme ✅ Works — no Alpine / Tailwind required
Custom themes ✅ Works — uses standard product.info.main container which exists in every theme
Mage-OS forks ✅ Works
Adobe Commerce ✅ Works
Headless / PWA Studio ⚠️ Storefront template bypassed; use the WarningResolver PHP API or expose a REST endpoint to surface the warnings in your headless front end

See COMPATIBILITY.md for the design choices that make this portable.


Quick start

# 1. Extract into your Magento root
unzip etechflow-module-product-warning-1.0.0.zip -d <magento-root>/

# 2. Enable + migrate
bin/magento module:enable Etechflow_ProductWarning
bin/magento setup:upgrade
bin/magento setup:di:compile      # production-mode only
bin/magento cache:flush

# 3. Visit the admin
open https://your-store.example.com/admin/etechflow_warning/warning/index
# (or: Admin sidebar → Catalog → Inventory Warning)

Three sample warnings are auto-seeded on first install. Edit one, assign it to a product or category, and reload the PDP — the banner renders above the price.


Documentation index

File Purpose
README.md Overview, features, compatibility (this file)
INSTALL.md Manual + Composer install + verification + troubleshooting
USAGE.md Admin walk-through — creating warnings, assigning to products / categories
CONFIGURATION.md Module-level customization options + how to move the banner block elsewhere
COMPATIBILITY.md Theme + Magento + PHP matrix and the choices that keep it portable
CHANGELOG.md Version history
UNINSTALL.md Clean removal (disable / drop tables / remove media)
LICENSE.txt proprietary license text

Support

  • Email: [email protected]
  • Include: Magento version, PHP version, active theme, steps to reproduce, screenshot of the PDP with browser inspector open.

License

proprietary — free for commercial and non-commercial use. See LICENSE.txt.

Changelog — ETechFlow Product Warning

All notable changes to this module. Adheres to Semantic Versioning.


[1.0.1] — 2026-06-03 — Critical: Fix class-load fatal in PDP Notice block

Fixed

  • Block/Frontend/Notice.php class-load fatal: the $resolver
    property was declared private, but Magento's \Magento\Framework\ View\Element\Template parent class declares its own $resolver as
    protected. PHP requires equal-or-weaker visibility on inherited
    property overrides, so v1.0.0 caused setup:di:compile and PDP
    render to fatal with:

    Fatal error: Access level to ETechFlow\ProductWarning\Block\Frontend\
    Notice::$resolver must be protected (as in class Magento\Framework\
    View\Element\Template) or weaker
    

    Caught on first local Docker install — php -l does NOT detect
    this class of bug
    because it's a class-load-time check, not a
    syntax check. Same bug class flagged in the eTechFlow memory after
    similar issues in earlier modules.

    Fix: renamed the property $resolver$warningResolver
    (along with the constructor parameter + every $this->resolver
    reference). Side-steps the collision entirely without shadowing the
    parent's actual layout resolver.

  • Same class of bug to watch for elsewhere: any Magento block
    that extends Template or AbstractBlock and declares a private
    property that shadows an inherited protected one. Most-common
    offenders: $resolver, $_resolver, $escaper, $_escaper,
    $jsLayout, $_template. php -l won't catch them. setup:di: compile will, on every install.

Added

  • Setup/Patch/Data/V101ReleaseMarker.php — always-a-patch
    discipline marker. Depends on SeedDefaultWarnings so patches run
    in correct version order.

Migration

composer require etechflow/module-product-warning:^1.0.1
bin/magento setup:upgrade
bin/magento setup:di:compile
bin/magento cache:flush

Pre-flight check:

SELECT module, schema_version, data_version FROM setup_module
WHERE module='ETechFlow_ProductWarning';

Both should read 1.0.1. If data_version is stale, re-run
setup:upgrade — do NOT flush cache yet.

Anyone who installed v1.0.0 hit the class-load fatal on the first
PDP render or setup:di:compile. v1.0.1 fixes it. Strongly
recommend upgrade for any v1.0.0 installs.


Added

  • Admin module under Catalog → Inventory Warning
    • Grid + edit form (Magento Ui Components)
    • Hex color picker, active toggle, sort order
    • Multi-tree category assignment picker
    • Multi-select product assignment picker (searchable by name / SKU)
    • ACL resource Etechflow_ProductWarning::warnings
  • Storefront PDP rendering — auto-injected via this module's own
    view/frontend/layout/catalog_product_view.xml. No theme override required.
  • WarningResolver PHP API for stores that want to render warnings
    elsewhere (cart, emails, listing pages, etc.)
  • DB schema (etc/db_schema.xml) — 3 tables:
    • etechflow_warning — master record (id, name, message, color, active, sort_order, timestamps)
    • etechflow_warning_category — category assignment pivot
    • etechflow_warning_product — product assignment pivot
  • Demo data installer patch — seeds 3 example warnings on first install
  • Scoped frontend CSS.epw-* namespace, inline <style> block
  • Zero JavaScript on frontend — pure server-rendered HTML
  • Documentation bundle
    • README, INSTALL, USAGE, COMPATIBILITY, CONFIGURATION, UNINSTALL, CHANGELOG, LICENSE

Compatibility

  • Magento 2.4.4 – 2.4.8
  • PHP 8.1, 8.2, 8.3
  • Hyvä Theme + Luma + custom themes
  • Adobe Commerce + Magento Open Source + Mage-OS

Migration

If you previously had the original Keystation_ProductWarning module on a
store, follow the data-copy SQL in INSTALL.md → Upgrading from Keystation_ProductWarning to bring the data across.


Versions
Version Stability QA Status Compatibility Released
1.1.5 stable Fail Magento 2.4.7-2.4.8 Details 2026-06-22 09:37:37
1.1.3 stable Not tested Not yet tested Details 2026-06-15 10:47:04
1.1.2 stable Not tested Not yet tested Details 2026-06-15 09:28:06
1.1.1 stable Not tested Not yet tested Details 2026-06-13 13:58:00
1.1.0 stable Not tested Not yet tested Details 2026-06-05 15:40:54
1.0.2 stable Not tested Not yet tested Details 2026-06-05 11:59:02
1.0.1 stable Not tested Not yet tested Details 2026-06-03 12:13:58
1.0.0 stable Not tested Not yet tested Details 2026-06-03 10:17:53

Requires 5

Package Constraint
magento/framework >=103.0
magento/module-backend >=102.0
magento/module-catalog >=104.0
magento/module-ui >=101.0
php ~8.1.0||~8.2.0||~8.3.0||~8.4.0

No QA results yet

QA pipelines haven't run for this version. Compatibility and quality results appear here once the vendor publishes a tagged release that gets ingested.

License
proprietary
Authors

More from etechflow

View vendor
Make it pay

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.