run-as-root / module-withdrawal-hyva
run-as-root/module-withdrawal-hyva
Hyva Theme compatibility for zwernemann/module-withdrawal
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
No changelog yet
The vendor hasn't published a changelog. Tagged releases appear in the Versions tab.
Requires 3
| Package | Constraint |
|---|---|
| php | >=7.4 |
| run-as-root/module-withdrawal | * |
| hyva-themes/magento2-theme-module | * |
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.
| 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.
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 run-as-root
View vendorMagento 2 EU Withdrawal Button Module - Adds a withdrawal/revocation button for orders in compliance with EU Directive (EU) 2023/2673
Provides the possibility to filter products by categories in Magento Admin Product Grid
Provides message queue retry processing functionality via RabbitMQ's dead letter exchange.
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.