---
title: Kowal_CheckoutComment
url: 'https://info.srv.kowal.co/docs/magento/modules/checkout-comment'
markdown: 'https://info.srv.kowal.co/docs/magento/modules/checkout-comment.md'
lang: en
date: '2026-11-29'
description: 'Enable order comments at checkout, find the saved note in the Magento Admin order grid and include it in order emails with the order_comment variable.'
taxonomy:
  category:
    - docs
    - Magento
    - Modules
  tag:
    - checkout
    - 'order comment'
    - 'sales order'
    - 'email templates'
    - 'admin configuration'
---

# Kowal\_CheckoutComment

Composer package **`kowal/module-checkoutcomment`** · repository version **1.0.17**

## Product page

[Kowal\_CheckoutComment — kowal.co](https://kowal.co/checkout-comment-add-order-comment-in-magento-2)

## Description

`Kowal_CheckoutComment` adds a customer comment field to Magento 2 checkout, persists the value on quote and order, exposes it in the Admin order grid, and injects it into email template variables as `order_comment`.

## For whom

- Magento developers implementing custom checkout data flow
- DevOps/release engineers deploying modules with checkout and database schema changes
- Store administrators configuring checkout comment behavior per scope

## Features

- Adds checkout UI component under checkout payment section (`afterMethods`) via `LayoutProcessor` plugin.
- Uses frontend mixin for `Magento_Checkout/js/action/place-order` to pass `checkout_comment` to payment extension attributes.
- Declares extension attributes for: 
    - `Magento\Quote\Api\Data\PaymentInterface`
    - `Magento\Quote\Api\Data\CartInterface`
    - `Magento\Sales\Api\Data\OrderInterface`
- Persists comment to quote through plugins on: 
    - `Magento\Quote\Api\PaymentMethodManagementInterface::savePaymentInformationAndPlaceOrder`
    - `Magento\Quote\Model\PaymentMethodManagement::set`
    - `Magento\Quote\Model\QuoteRepository::save`
- Copies comment from quote to order in observer for `sales_model_service_quote_submit_before`.
- Adds `checkout_comment` columns in DB (declarative schema) for: 
    - `quote`
    - `sales_order`
    - `sales_order_grid`
- Extends order grid resource model column mapping and adds UI grid column in Admin.
- Adds Data Patch that marks order attribute grid-enabled and backfills `sales_order_grid.checkout_comment` from `sales_order`.
- Adds `order_comment` variable to order emails through plugins on `SenderBuilder`, `TransportBuilder`, and `TransportBuilderByStore`.
- Optional fallback for email comment source from order status history controlled by config flag `checkout_comment/general/all_frontend_comments`.

## Installation

\* = in production please use the `--keep-generated` option

### Type: Composer

1. **Add the composer repository to the configuration:**

    ```bash

    composer config repositories.checkout.comment vcs https://github.com/kowalco/magento-2-checkout-comment
    ```
2. **Add an access token for the private GitLab repository:**

    ```bash

    composer config --global --auth github-oauth.github.com <YOUR_TOKEN>
    ```
3. **Install the module using Composer:**

    ```bash

    composer require kowal/module-checkoutcomment
    ```
4. **Enable the module:**

    ```bash

    php bin/magento module:enable Kowal_CheckoutComment
    ```
5. **Apply database updates:**

    ```bash

    php bin/magento setup:upgrade
    ```
6. **Flush the cache:**

    ```bash

    php bin/magento cache:flush
    ```

## Configuration

- Admin path (system config): `Stores > Configuration > kowal > Checkout Comment` (section id: `checkout_comment`, group: `general`).
- Fields: 
    - `checkout_comment/general/enable` (Yes/No)
    - `checkout_comment/general/all_frontend_comments` (Yes/No)
- Scope availability in `system.xml`: `default`, `website`, `store view` (all enabled).
- Runtime read scope in helper: store scope (`ScopeInterface::SCOPE_STORE`).
- Default values (`etc/config.xml`): 
    - `enable = 1`
    - `all_frontend_comments = 0`
- Admin menu entries are defined in `etc/adminhtml/menu.xml` (including parent under `Kowal_Base::kowal_modules`).
- ACL note: this module references ACL resources (`Kowal_CheckoutComment::config`, `::root`, `::general`) but does not provide `etc/acl.xml` locally.

## Requirements / notes

- Composer dependency: `kowal/base`.
- Module sequence dependency: `Magento_Checkout`.
- Email template rendering requires template-level usage of `order_comment`; module only injects variable.
- Source contains extensive debug logging (`error`/`debug`) in checkout and email plugins.
- `Observer/Frontend/Checkout/SubmitAllAfter.php` exists but is not wired in `etc/events.xml`.
- Data model includes both declarative schema (`db_schema.xml`) and data patch logic for grid-related behavior.

### Deployment and Operations

- Run `php bin/magento setup:upgrade` for declarative schema + data patch execution.
- Run `php bin/magento setup:di:compile` in production mode (plugins, extension attributes, interceptors).
- Run static content deployment in production mode to publish frontend assets from `view/frontend`.
- Flush caches after deployment (`config`, `layout`, `block_html`, full page cache as needed).
- Verify checkout rendering: 
    - Checkout payment step displays comment textarea.
    - Placing order with comment stores value on order.
- Verify Admin: 
    - Sales order grid contains `Checkout Comment` column.
- Verify email templates: 
    - `order_comment` variable is available (template snippet is provided in README Configuration section).

### Deployment Checklist

- Module package installed through Composer.
- Module enabled (`Kowal_CheckoutComment`).
- `setup:upgrade` executed successfully.
- DB columns exist in `quote`, `sales_order`, `sales_order_grid`.
- Data patch `AddCheckoutCommentToGrid` applied.
- DI compilation and static content deployment completed (production).
- Cache flushed.
- Config reviewed per required scope (default/website/store view).
- Checkout comment persisted from storefront to order.
- Order grid and email variables validated.
- Dependency `kowal/base` present and active.

### CI/CD and Environments

- No custom cron jobs, message queue consumers, or custom indexers are defined in this module.
- Recommended pipeline steps: 
    - `composer install`
    - `php bin/magento module:enable Kowal_CheckoutComment` (when not pre-enabled)
    - `php bin/magento setup:upgrade`
    - `php bin/magento setup:di:compile` (production)
    - `php bin/magento setup:static-content:deploy` (production)
    - `php bin/magento cache:flush`
- Environment validation should include end-to-end checkout + email template smoke tests.

### Rollback

- Code rollback: revert Composer package version and deploy previous lockfile.
- Database note: this module introduces schema columns; rollback requires explicit migration strategy if removing module.
- After rollback, run standard Magento deployment commands (`setup:upgrade`, cache refresh) according to target state.

### Compatibility

- Module type: Magento 2 module (`type: magento2-module`).
- No explicit Magento version constraint is declared in this package.
- Frontend implementation targets standard Magento 2 Knockout checkout architecture.

## FAQ

### Is there only Composer-based installation?

Yes. README provides only Composer installation flow.

### Where exactly is config scope controlled?

`system.xml` exposes default/website/store view. Runtime checks use store scope reads.

### Does this module define its own ACL file?

No `etc/acl.xml` is present in this module.

### Does the module define cron, queue, or custom indexers?

No custom cron, queue, or indexer definitions were found.

### Are there any gaps that require manual verification?

Yes:

- README installation code blocks are not properly closed in source text.
- README mentions a "private GitLab repository" while command targets GitHub OAuth and GitHub URL.
- Because ACL definitions are not present locally, permissions behavior should be verified in target environment.

## Verify the installation

```sh
bin/magento module:status Kowal_CheckoutComment
```

Place a test order with a short comment. In the orders grid, locate the order number and verify that its comment matches the text entered at checkout.

Use a distinctive comment and check the exact order number when reviewing the grid. This also distinguishes the checkout text from notes added later by an operator.

---

## Navigation

- Parent: [Magento 2 Extensions](https://info.srv.kowal.co/docs/magento/modules.md)
- Previous: [Automatic Related Products](https://info.srv.kowal.co/docs/magento/modules/automatic-related-products.md)
- Next: [Auto Hide Message](https://info.srv.kowal.co/docs/magento/modules/auto-hide-message.md)
