# run-as-root/module-withdrawal-hyva

> Hyva Theme compatibility for zwernemann/module-withdrawal

`composer require run-as-root/module-withdrawal-hyva`

Canonical URL: https://packagento.com/run-as-root/module-withdrawal-hyva

## At a glance

- **Vendor**: run-as-root (https://packagento.com/run-as-root.md)
- **Latest version**: 1.0.0-p2 — released 2026-05-19
- **Pricing**: Free
- **Package type**: Magento 2 module
- **Status**: active, accepting new buyers

## Installation

Packagento is licence-gated, so even free packages need a licence on a project before Composer can resolve them.

1. **Sign in or create an account** at https://packagento.com/customer/account/.

2. **Add the package to your account.** Open https://packagento.com/run-as-root/module-withdrawal-hyva and complete the free checkout. A licence is minted automatically.

3. **Create or pick a project, then activate the licence on it.**
   - Projects represent the Magento installs you deploy to. Manage them at https://packagento.com/projects/.
   - Activate the new licence on the project you'll deploy this package to. Activation is what generates the Composer credentials scoped to that project.

4. **Add the project credentials to your Magento codebase.**

   Grab the project's public + private key from https://packagento.com/projects/ (open the project, then its Credentials tab), and add them to `auth.json`:

   ```json
   {
     "http-basic": {
       "packagento.com": {
         "username": "ppk_live_...",
         "password": "psk_live_..."
       }
     }
   }
   ```

   Add the Packagento Composer repository to `composer.json`:

   ```json
   {
     "repositories": [
       { "type": "composer", "url": "https://packagento.com" }
     ]
   }
   ```

5. **Install and apply.**

   ```bash
   composer require run-as-root/module-withdrawal-hyva:*
   bin/magento setup:upgrade
   bin/magento setup:di:compile
   bin/magento cache:flush
   ```

## What it does

Hyva Theme compatibility for zwernemann/module-withdrawal

## README

A companion module for [Zwernemann_Withdrawal](https://github.com/Zwernemann/magento2-withdrawl) that replaces all frontend templates with Hyvä-compatible equivalents built on **Tailwind CSS** and **Alpine.js**.

---

### Base Module

The [magento2-withdrawl](https://github.com/Zwernemann/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](https://hyva.io) 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

```bash
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)](https://opensource.org/licenses/OSL-3.0)

## Recent Versions

| Version | Released |
|---|---|
| 1.0.0-p2 | 2026-05-19 |
| 1.0.0-p1 | 2026-04-29 |

## Dependencies

### Require

| Package | Constraint |
|---|---|
| hyva-themes/magento2-theme-module | * |
| php | >=7.4 |
| run-as-root/module-withdrawal | * |

## Quality

Latest release (1.0.0-p2) passes the Packagento QA pipeline. Verdicts below are per-cell (Magento line × PHP version) for the matrixed tools, and run-once for the static / security tiers.


### Compatibility

Each Magento line is installed on its supported PHP versions, then the module is built (DI compile + static-content deploy). Cells show passed / failed / untested; staircase gaps render as `–`.

| 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. Never affect the Compatibility verdict — 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 | 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 against a real Magento install. Re-runs per Magento + PHP version because resolvable symbols differ between releases.

| 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 per Magento + PHP cell. Test failures speak to the module's behaviour, not its compatibility with a line, so they're reported here separately.

#### 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

Dependency-advisory audit (composer audit) plus a source malware scan. A malware detection fails the version outright.

| 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 |  |

## Licence and pricing

Free. A licence is still minted on checkout and bound to your project for Composer access — no payment step.

Refundable within 14 days of first purchase via https://packagento.com/account/refunds/.

## Install via Claude Code or any MCP client

The Packagento MCP server can run the licence + project + Composer steps above in one tool call:

```
purchase_and_install_packages(
  composer_names=["run-as-root/module-withdrawal-hyva"],
  project_id="proj_xxx"
)
```

This handles cart, checkout, licence minting, project activation, and writes auth.json credentials. Connect a client with `claude mcp add packagento https://mcp.packagento.com`. Full setup at https://packagento.com/docs/mcp-setup.

## Vendor

run-as-root is a Magento 2 vendor on Packagento. See https://packagento.com/run-as-root.md for their full catalogue.

