run-as-root / module-withdrawal-hyva

run-as-root/module-withdrawal-hyva

Hyva Theme compatibility for zwernemann/module-withdrawal

magento2-module Compatibility: Not yet tested Code Quality: Fail Tests: N/A Security: Pass OSL-3.0

Magento 2 Withdrawal – Hyvä Compatibility Module

A companion module for Zwernemann_Withdrawal that replaces all frontend templates with Hyvä-compatible equivalents built on Tailwind CSS and Alpine.js.


Base Module

The magento2-withdrawl module implements the EU statutory right of withdrawal for Magento 2 stores. It covers the full workflow from the customer's initial request to the merchant's administrative handling.

Features of the base module

Customer side

  • Withdrawal button in the order history list and on the order detail page
  • Dedicated withdrawal detail page showing order summary, ordered items, and the applicable deadline
  • Guest customer support via a separate order search form
  • Automatic confirmation email after a withdrawal has been submitted

Merchant side

  • Admin grid listing all withdrawal requests with filtering and sorting
  • Configurable withdrawal period (default: 14 days from shipment date)
  • Automatic order comments on withdrawal submission
  • Customisable transactional email templates
  • REST API endpoint for programmatic access

Technical

  • Supports Magento 2.4.6 – 2.4.8-p1
  • Full translations for German and English (97 strings)
  • CSRF protection on all forms
  • ACL-based backend permissions

This Module – Hyvä Compatibility

The default Magento frontend (Luma) uses RequireJS, Knockout.js, and LESS for its UI stack. Hyvä Themes replaces this stack with Tailwind CSS and Alpine.js, which means standard Luma templates are incompatible and render unstyled or broken in a Hyvä storefront.

This companion module solves that by providing a dedicated set of templates that follow Hyvä conventions – no Knockout, no RequireJS, no LESS.

What is replaced / added

Template Description
withdrawal/view.phtml Withdrawal detail page with order summary table, deadline display, and an Alpine.js confirmation modal before form submission
withdrawal/success.phtml Success confirmation page with order reference and navigation links
order/history/withdrawal_button.phtml Table cell for the order history list – shows the withdraw button, a "submitted" notice, or an "expired" notice depending on the order state
order/history/column_header.phtml Column header cell for the withdrawal column in the order history table
guest/search.phtml Guest order search form with Alpine.js form-state handling and HTML5 validation
button.phtml Standalone button component linking to the withdrawal view

Key implementation details

  • Tailwind CSS utility classes are used throughout for layout, typography, colour, and spacing – no custom LESS or CSS is added.
  • Alpine.js handles interactive elements such as the confirmation modal (x-data="{ showConfirm: false }") and submit-button disabling during form submission.
  • CSRF form keys are included in every form, identical to the base module.
  • Both logged-in customers and guests are fully supported.

Requirements

Dependency Version
PHP >= 7.4
Magento 2.4.6 – 2.4.8-p1
zwernemann/module-withdrawal >= 1.0.0
hyva-themes/magento2-theme-module *

Installation

composer require zwernemann/module-withdrawal-hyva
php bin/magento module:enable Zwernemann_WithdrawalHyva
php bin/magento setup:upgrade
php bin/magento cache:flush

Usage

No additional configuration is required. Once enabled, the module's templates automatically take precedence over the base module's templates when a Hyvä theme is active. All configuration options from the base module remain available under Stores → Configuration → Sales → Withdrawal.


Contributing

Contributions and bug reports are welcome. Please open an issue or pull request in this repository.


License

Open Software License 3.0 (OSL-3.0)

No changelog yet

The vendor hasn't published a changelog. Tagged releases appear in the Versions tab.

Versions
Version Stability QA Status Compatibility Released
1.0.0-p2 stable Pass Not yet tested Details 2026-05-19 15:33:16
1.0.0-p1 stable Not tested Not yet tested Details 2026-04-29 14:16:34

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.

Compatibility matrix (Magento × PHP)
Magento PHP 8.2 PHP 8.3 PHP 8.4 PHP 8.5
2.4.7 not tested not tested
2.4.8 not tested not tested
2.4.9 not tested not tested

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.

Static analysis results
Tool Status Findings Summary
PHPCS Warning 64 64 warnings (ruleset: Magento2) — 49 auto-fixable with phpcbf
PHPMD Pass 0
Cpd Pass 0
Composer validate Info 3 valid; 3 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.

PHPStan results by Magento and PHP version
Magento PHP 8.2 PHP 8.3 PHP 8.4 PHP 8.5
2.4.7 Error Error
2.4.8 Error Error
2.4.9 Error Error

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

Unit tests results by Magento and PHP version
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

Integration tests results by Magento and PHP version
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.

Security results
Tool Status Findings Summary
Composer audit N/A 0 no resolvable dependency tree to audit — Your requirements could not be resolved to an installable set of packages. Problem 1
Malware scan Pass 0
License
OSL-3.0

More from run-as-root

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.