The Home for Magento 2 Excellence

Quality-tested Magento 2 modules. Explore. Evaluate. Elevate. #magento2

1090 Modules
617 Ready
473 Need Help
๐Ÿ† Leaderboard
Actively Maintained v2.0.0

Checkout Custom Form

sbodak/magento2-checkout-custom-form

Adds a configurable custom form to the Magento 2 checkout shipping step for both guests and logged-in customers, with per-store-view enable/disable and optional character limits per field. Entered data is saved to the order, exposed via order extension attributes, and settable through REST API endpoints.

3,525
Downloads
Below average
99
GitHub Stars
5x above avg
2mo ago
Last Release
7
Open Issues
Build Passing
Ready to install

Build Tests

Composer Install
DI Compile
Templates

Code Quality

CS Coding Standard
18 errors , 138 warnings
PHPStan Failed

Tested on Magento 2.4.9

Recent Test History

Each release is tested against the latest Magento version at that time.

v2.0.0 on Magento 2.4.9
Jun 1, 2026

Share This Module's Status

Checkout Custom Form Magento compatibility status badge

README

Loaded from GitHub

Magento 2 โ€“ Checkout Custom Form

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

Field Config key
Buyer 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

Method Endpoint Auth
PUT /V1/carts/mine/set-order-custom-fields Customer
PUT /V1/guest-carts/:cartId/set-order-custom-field Guest

Compatibility

Module version Magento PHP
2.0.* 2.4.6 โ€“ 2.4.8 8.1 ยท 8.2 ยท 8.3 ยท 8.4
1.2.* 2.3.x 7.x
1.1.* 2.1.x โ€“ 2.2.x (no longer supported)

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

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

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

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

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


Screenshots

Checkout โ€“ Guest

Checkout frontend custom form โ€“ Guest

Checkout โ€“ Logged in

Checkout frontend custom form โ€“ Logged in

Customer account โ€“ Order history

Customer account โ€“ Order history view

Admin panel โ€“ Order edit

Admin panel โ€“ order edit


Running Tests

composer install
vendor/bin/phpunit

Uninstall

php bin/magento module:uninstall Bodak_CheckoutCustomForm

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


Changelog

See CHANGELOG.md.

License

MIT License

This content is fetched directly from the module's GitHub repository. We are not the authors of this content and take no responsibility for its accuracy, completeness, or any consequences arising from its use.