PHPackages                             sbodak/magento2-checkout-custom-form - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. sbodak/magento2-checkout-custom-form

ActiveMagento2-module[Utility &amp; Helpers](/categories/utility)

sbodak/magento2-checkout-custom-form
====================================

Add a custom form to Magento 2 checkout on the shipping step.

2.0.0(3w ago)993.5k65[7 issues](https://github.com/sbodak/magento2-checkout-custom-form/issues)MITPHPPHP ^8.1|^8.2|^8.3|^8.4

Since Nov 11Pushed 3w ago9 watchersCompare

[ Source](https://github.com/sbodak/magento2-checkout-custom-form)[ Packagist](https://packagist.org/packages/sbodak/magento2-checkout-custom-form)[ RSS](/packages/sbodak-magento2-checkout-custom-form/feed)WikiDiscussions master Synced 2d ago

READMEChangelogDependencies (7)Versions (14)Used By (0)

Magento 2 – Checkout Custom Form
================================

[](#magento-2--checkout-custom-form)

Overview
--------

[](#overview)

Adds a configurable custom form to the Magento 2 checkout (shipping step), placed above the shipping-method selection.
The form works for both logged-in customers and guests.
After an order is placed, all entered data is stored in the `sales_order` table and exposed via extension attributes on `OrderInterface`.
Form data persists through page refreshes as long as the cart is active.

Fields can be individually **enabled or disabled per store view** from the admin panel.
Optional **character-length limits** can be configured for each field.

### Default form fields

[](#default-form-fields)

FieldConfig keyBuyer name`checkout_buyer_name`Buyer email`checkout_buyer_email`Purchase order no.`checkout_purchase_order_no`Goods mark`checkout_goods_mark`Comment`checkout_comment`### API endpoints

[](#api-endpoints)

MethodEndpointAuth`PUT``/V1/carts/mine/set-order-custom-fields`Customer`PUT``/V1/guest-carts/:cartId/set-order-custom-field`Guest---

Compatibility
-------------

[](#compatibility)

Module versionMagentoPHP`2.0.*`2.4.6 – 2.4.88.1 · 8.2 · 8.3 · 8.4`1.2.*`2.3.x7.x`1.1.*`2.1.x – 2.2.x*(no longer supported)*---

Installation
------------

[](#installation)

```
composer require sbodak/magento2-checkout-custom-form
php bin/magento module:enable Bodak_CheckoutCustomForm
php bin/magento setup:upgrade
php bin/magento setup:di:compile
php bin/magento cache:flush
```

---

Admin Configuration
-------------------

[](#admin-configuration)

Go to **Stores → Configuration → Sales → Checkout → Checkout Custom Form Configuration**.

- **Enabled Form Fields** – multiselect; choose which fields appear in the checkout.
- **\*\* Character Limit** fields – optionally restrict the maximum length of each field (leave empty for no limit).

---

Customisation
-------------

[](#customisation)

### Adding / removing fields

[](#adding--removing-fields)

1. Add the constant to `Api/Data/CustomFieldsInterface.php` and the `ATTRIBUTES` array.
2. Add the column to `Setup/Patch/Data/AddCustomFields.php`.
3. Extend `Model/Data/CustomFields.php` with getters, setters, and `isXxxEnabled()`.
4. Register the field in `Model/Config/Source/Option.php`.
5. Add it to `Model/Checkout/LayoutProcessor/Plugin.php` (`$fields` array).
6. Update `Observer/AddCustomFieldsToOrder.php` if custom mapping is required.
7. Update `Observer/Sales/OrderLoadAfter.php` to populate the extension attribute.
8. Update templates in `view/adminhtml/templates/order/view/custom_fields.phtml`and `view/frontend/templates/order/view/custom_fields.phtml`.

### Making a field required

[](#making-a-field-required)

In `Model/Checkout/LayoutProcessor/Plugin.php`, add a `validation` key to the field array:

```
[
    'dataScopeName' => CustomFieldsInterface::CHECKOUT_PURCHASE_ORDER_NO,
    'label'         => 'Purchase order no.',
    'validation'    => ['required-entry' => true],
],
```

### Overriding translations

[](#overriding-translations)

Edit `i18n/en_US.csv` (or create a language-specific CSV, e.g. `de_DE.csv`).

---

Screenshots
-----------

[](#screenshots)

### Checkout – Guest

[](#checkout--guest)

[![Checkout frontend custom form – Guest](docs/frontened_checkout_custom_form_guest.png)](docs/frontened_checkout_custom_form_guest.png)

### Checkout – Logged in

[](#checkout--logged-in)

[![Checkout frontend custom form – Logged in](docs/frontened_checkout_custom_form_logged.png)](docs/frontened_checkout_custom_form_logged.png)

### Customer account – Order history

[](#customer-account--order-history)

[![Customer account – Order history view](docs/frontend_customer_account_orders.png)](docs/frontend_customer_account_orders.png)

### Admin panel – Order edit

[](#admin-panel--order-edit)

[![Admin panel – order edit](docs/backend_order_custom_information.png)](docs/backend_order_custom_information.png)

---

Running Tests
-------------

[](#running-tests)

```
composer install
vendor/bin/phpunit
```

---

Uninstall
---------

[](#uninstall)

```
php bin/magento module:uninstall Bodak_CheckoutCustomForm
```

This drops the custom columns from the `sales_order` and `quote` tables.

---

Changelog
---------

[](#changelog)

See [CHANGELOG.md](CHANGELOG.md).

License
-------

[](#license)

[MIT License](LICENSE)

###  Health Score

64

—

FairBetter than 99% of packages

Maintenance93

Actively maintained with recent releases

Popularity37

Limited adoption so far

Community19

Small or concentrated contributor base

Maturity88

Battle-tested with a long release history

 Bus Factor1

Top contributor holds 81% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~280 days

Recently: every ~692 days

Total

12

Last Release

26d ago

Major Versions

1.2.1 → 2.0.02026-04-18

PHP version history (3 changes)1.0.0PHP ~7.0.0

1.1.3PHP ~7.0.0|~7.1.3|~7.2.0

2.0.0PHP ^8.1|^8.2|^8.3|^8.4

### Community

Maintainers

![](https://www.gravatar.com/avatar/518113abdd47a519a9fad1df5a6317b250e8b34448342436f70bf7b51624df40?d=identicon)[sbodak](/maintainers/sbodak)

---

Top Contributors

[![sbodak](https://avatars.githubusercontent.com/u/25949343?v=4)](https://github.com/sbodak "sbodak (17 commits)")[![WebWeave](https://avatars.githubusercontent.com/u/17380630?v=4)](https://github.com/WebWeave "WebWeave (4 commits)")

---

Tags

magento-2magento2magento2-checkoutmagento2-extensionmagento2-modulemagento2magento2 modulecustom checkoutcheckout form

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/sbodak-magento2-checkout-custom-form/health.svg)

```
[![Health](https://phpackages.com/badges/sbodak-magento2-checkout-custom-form/health.svg)](https://phpackages.com/packages/sbodak-magento2-checkout-custom-form)
```

###  Alternatives

[mollie/magento2

Mollie Payment Module for Magento 2

1121.6M10](/packages/mollie-magento2)[run-as-root/magento2-prometheus-exporter

Magento2 Prometheus Exporter

69344.4k](/packages/run-as-root-magento2-prometheus-exporter)[dotdigital/dotdigital-magento2-extension

Dotdigital for Magento 2

50374.2k18](/packages/dotdigital-dotdigital-magento2-extension)[opengento/module-gdpr

Gdpr Compliance Module for Magento 2

14481.5k](/packages/opengento-module-gdpr)[smile/module-store-delivery

Smile Store Delivery

23348.7k1](/packages/smile-module-store-delivery)[medialounge/magento2-storyblok-integration

Magento 2 extension to integrate Storyblok visual editor

2965.1k](/packages/medialounge-magento2-storyblok-integration)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
