# storetown-media/module-onepagecheckout

> One Page Checkout for Magento 2 — All checkout steps on a single page with AJAX validation, real-time shipping calculation, and responsive design. Compatible with Luma, Blank, and Hyvä themes.

`composer require storetown-media/module-onepagecheckout`

Canonical URL: https://packagento.com/storetown-media/module-onepagecheckout

## At a glance

- **Vendor**: Storetown Media (https://packagento.com/storetown-media.md)
- **Latest version**: v1.6.3 — released 2026-08-23
- **Pricing**: $150.00/year, subscription
- **Package type**: Magento 2 module
- **Status**: active, accepting new buyers

## Installation

This is a paid package. The Packagento install flow is licence-gated, so a Composer install needs a licence + project + project credentials in place first.

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

2. **Purchase the package.** Open https://packagento.com/storetown-media/module-onepagecheckout, add it to your cart, and complete checkout. A licence is minted automatically once payment clears.

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 storetown-media/module-onepagecheckout:*
   bin/magento setup:upgrade
   bin/magento setup:di:compile
   bin/magento cache:flush
   ```

## What it does

One Page Checkout for Magento 2 — All checkout steps on a single page with AJAX validation, real-time shipping calculation, and responsive design. Compatible with Luma, Blank, and Hyvä themes.

## README

A complete, theme-independent One Page Checkout extension for Magento 2.

### Features

- **Theme-independent** — Works with Hyva, Luma, Blank, or any custom theme
- **All steps on one page** — Address, shipping, payment in a single view
- **AJAX-based** — No page reloads, real-time shipping/payment calculation
- **Responsive design** — Optimized for desktop, tablet, and mobile
- **Admin-configurable** — Colors, layout, form fields, trust badges
- **PLZ autofill** — Automatic city lookup for DE/AT/CH postal codes
- **Guest checkout with optional registration** — Create customer account during checkout
- **Method icon customization** — Custom icons and descriptions for shipping/payment methods
- **Trust badges** — Configurable trust badges (SSL, shipping, returns, etc.)
- **PSP integrations** — Mollie, Adyen, Stripe, PayOne, Unzer, Amazon Pay, PayPal, Klarna
- **i18n ready** — Full translation support via Magento's i18n system (de_DE included)

### Requirements

- **PHP:** 7.4, 8.0, 8.1, or 8.2
- **Magento:** 2.4.4 or higher
- **Dependencies:** Magento_Checkout, Magento_Customer, Magento_Sales, Magento_Quote, Magento_Payment, Magento_Shipping, Magento_Directory, Magento_Tax, Magento_Eav, Magento_Paypal

### Installation

#### Via Composer (recommended)

```bash
composer require ia24/module-onepagecheckout
php bin/magento module:enable IA24_OnePageCheckout
php bin/magento setup:upgrade
php bin/magento setup:di:compile
php bin/magento cache:clean
php bin/magento setup:static-content:deploy de_DE -f
```

#### Manual Installation

1. Copy the module to `app/code/IA24/OnePageCheckout/`
2. Run:
```bash
php bin/magento module:enable IA24_OnePageCheckout
php bin/magento setup:upgrade
php bin/magento setup:di:compile
php bin/magento cache:clean
php bin/magento setup:static-content:deploy de_DE -f
```

### Configuration

**Stores > Configuration > IA24 > One Page Checkout**

#### General
- **Enabled:** Yes/No
- **Title:** Checkout page title

#### Design
- **Primary color:** Hex code (default: #0078b3)
- **Accent color:** Hex code (default: #e85e0c)
- **Layout:** One column / Two columns / Accordion

#### Form Fields
- **Show company:** Yes/No
- **Show telephone:** Yes/No
- **Telephone required:** Yes/No
- **Show order comment:** Yes/No
- **Show VAT ID:** Yes/No

#### Trust Badges
- **Show trust badges:** Yes/No
- **Badge position:** Above order button / Below summary / Sidebar / Footer
- **Badge style:** Horizontal / Vertical / Grid / Compact

#### PLZ Autofill
- **Enable PLZ autofill:** Yes/No
- **Countries:** DE, AT, CH (configurable)

### Usage

After activation, the standard checkout is automatically redirected to the One Page Checkout:
- Standard URL: `/checkout/` → Redirected to `/ia24checkout/`
- Direct URL: `/ia24checkout/`

### Payment Integrations

The module supports all Magento-compatible payment methods. Special handling is included for:

| PSP | Features |
|-----|----------|
| PayPal | Express Checkout, redirect handling, Error #10413 fix |
| Mollie | Pre-order redirect, payment token generation |
| Adyen | State data preparation, payment status checking |
| Stripe | Checkout session handling, redirect |
| PayOne | Multiple sub-methods with individual icons |
| Unzer | SDK integration, redirect handling |
| Amazon Pay | Session management, adapter integration |
| Klarna | Redirect handling via generic fallback |

### Customization

#### CSS Variables

Colors are defined via CSS custom properties and configurable via admin:

```css
:root {
    --ia24-primary: #0078b3;
    --ia24-accent: #e85e0c;
}
```

#### Layout Options

1. **one-column** — Vertical layout, optimal for mobile
2. **two-column** — Forms left, summary right (default)
3. **two-column-reverse** — Summary left, forms right
4. **accordion** — Steps as collapsible accordion elements

### Troubleshooting

#### Checkout shows no shipping methods
- Verify shipping methods are configured for the selected country
- Check `var/log/system.log` for errors

#### Shipping/payment methods not loading
- Run `php bin/magento setup:di:compile` after any constructor changes
- Delete `generated/` directory and re-compile
- Check AJAX responses in browser DevTools (Network tab)

#### PLZ autofill not working
- Verify PLZ data files exist in `data/postcode/` directory
- Check that the country is enabled in admin config
- See `docs/PLZ_AUTOFILL.md` for detailed documentation

#### Styling issues
- Clear browser cache
- Run `php bin/magento cache:flush`
- Re-deploy static content: `php bin/magento setup:static-content:deploy de_DE -f`

#### PayPal Error #10413
- This is handled automatically by the PayOne/NVP plugins
- If it persists, check PayPal merchant account settings

### Support

For questions or issues, check:
- `var/log/system.log`
- `var/log/exception.log`
- Browser DevTools (F12) Network tab for AJAX errors

## Changelog

All notable changes to the IA24 OnePageCheckout module are documented in this file.

### [1.5.1] - 2026-07-04

#### Added (Consumer Rights + account withdrawal)

- Checkout Consumer Rights feature set (EU consumer rights, effective 2026-06-19). New admin section *Stores → Configuration → STM → One Page Checkout → Consumer Rights*:
  - Statutory warranty notice (configurable heading + HTML text) with selectable placements (checkout above the order button, order confirmation page)
  - Online right-of-withdrawal form for both registered customers and guests at `ia24checkout/withdrawal` — name, address, order number, order/receipt dates, full vs. partial scope, item description and optional reason; standard POST (form_key protected) so it works without JavaScript
  - Configurable placement of the withdrawal link (checkout legal notices, order confirmation page, checkout footer)
  - Logged-in customers get the form prefilled from their default address; submitted values are repopulated via `DataPersistor` on validation errors
  - Soft order matching: the entered order number + e-mail is linked to the real `sales_order` when found, but a submission is never blocked on a mismatch
  - Online form auto-fill: entering the order number together with the order e-mail pre-fills name, address and order date via an AJAX lookup (`ia24checkout/withdrawal/lookup`), and the order's purchased items are offered as a selectable checkbox list
  - Per-order withdrawal from the customer account: every order in *My Account → My Orders → View Order* shows a "Submit a withdrawal for this order" button that opens the form pre-filled for that exact order (order number, e-mail, name, address, date) with the order's products as selectable checkboxes; access is ownership-checked server-side. The button is hidden for canceled and closed orders, and an optional setting ("Account Button Only Within Period", default off) hides it once the withdrawal period has elapsed (based on shipment date + withdrawal period)
- Withdrawal persistence + admin workflow:
  - New table `ia24_withdrawal_request` (declarative `etc/db_schema.xml`) with ORM model/resource/collection
  - Admin grid under *Sales → STM Withdrawals* (UI component listing, ACL `IA24_OnePageCheckout::withdrawal`) plus a detail view with status (new/acknowledged/processed/rejected) and internal notes
- Automated notifications via `Model\WithdrawalNotifier`: merchant alert (recipient configurable, falls back to the general store e-mail) and an optional consumer confirmation; two transactional e-mail templates (`ia24_withdrawal_merchant`, `ia24_withdrawal_customer`)
- German translations for all new strings (`i18n/de_DE.csv`); other locales fall back to the English source

#### Fixed (Adobe Marketplace QA — resubmission 2026-05-15)

_(Changelog truncated for .md surface. Full history on https://packagento.com/storetown-media/module-onepagecheckout.)_

## Recent Versions

| Version | Released |
|---|---|
| v1.6.3 | 2026-08-23 |

## Dependencies

### Require

| Package | Constraint |
|---|---|
| magento/framework | >=103.0 |
| magento/module-backend | >=102.0 |
| magento/module-catalog | >=104.0 |
| magento/module-checkout | >=100.4 |
| magento/module-checkout-agreements | >=100.3 |
| magento/module-config | >=101.2 |
| magento/module-customer | >=103.0 |
| magento/module-directory | >=100.4 |
| magento/module-eav | >=102.1 |
| magento/module-newsletter | >=100.4 |
| magento/module-payment | >=100.4 |
| magento/module-paypal | >=100.4 |
| magento/module-quote | >=101.2 |
| magento/module-sales | >=103.0 |
| magento/module-sales-rule | >=101.2 |
| magento/module-shipping | >=100.4 |
| magento/module-store | >=101.1 |
| magento/module-tax | >=100.4 |
| magento/module-ui | >=101.2 |
| php | >=8.1 |

## Quality

Latest release (v1.6.3) fails 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 | Pass | Pass | – | – |
| 2.4.8 | – | Pass | Pass | – |
| 2.4.9 | – | – | Pass | Pass |


### 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 | 2 | 2 warnings (ruleset: Magento2) |
| PHPMD | Warning | 239 | 239 rule violations (UnusedPrivateField:234, ExcessiveClassLength:4, TooManyFields:1) |
| Cpd | Warning | 7 | 7 duplicated chunks spanning 320 total lines (min-lines=5, min-tokens=70) |
| Composer validate | Info | 19 | valid; 19 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 | 77 | 77 | – | – |
| 2.4.8 | – | 77 | 77 | – |
| 2.4.9 | – | – | 77 | 77 |


### 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 | Pass | 0 |  |
| Malware scan | Pass | 0 |  |

## Licence and pricing

Subscription — $150.00/year, auto-renews until cancelled. Includes all minor + patch upgrades within the licensed major. One licence per project; cancelling stops auto-renewal but the existing licence keeps working until its end date.

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=["storetown-media/module-onepagecheckout"],
  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

Storetown Media is a Magento 2 vendor on Packagento. See https://packagento.com/storetown-media.md for their full catalogue.

