Kowal_CheckoutComment
Composer package kowal/module-checkoutcomment · repository version 1.0.17
Product page
Kowal_CheckoutComment — kowal.co
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) viaLayoutProcessorplugin. - Uses frontend mixin for
Magento_Checkout/js/action/place-orderto passcheckout_commentto payment extension attributes. - Declares extension attributes for:
Magento\Quote\Api\Data\PaymentInterfaceMagento\Quote\Api\Data\CartInterfaceMagento\Sales\Api\Data\OrderInterface
- Persists comment to quote through plugins on:
Magento\Quote\Api\PaymentMethodManagementInterface::savePaymentInformationAndPlaceOrderMagento\Quote\Model\PaymentMethodManagement::setMagento\Quote\Model\QuoteRepository::save
- Copies comment from quote to order in observer for
sales_model_service_quote_submit_before. - Adds
checkout_commentcolumns in DB (declarative schema) for:quotesales_ordersales_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_commentfromsales_order. - Adds
order_commentvariable to order emails through plugins onSenderBuilder,TransportBuilder, andTransportBuilderByStore. - 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
-
Add the composer repository to the configuration:
composer config repositories.checkout.comment vcs https://github.com/kowalco/magento-2-checkout-comment -
Add an access token for the private GitLab repository:
composer config --global --auth github-oauth.github.com <YOUR_TOKEN> -
Install the module using Composer:
composer require kowal/module-checkoutcomment -
Enable the module:
php bin/magento module:enable Kowal_CheckoutComment -
Apply database updates:
php bin/magento setup:upgrade -
Flush the cache:
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 = 1all_frontend_comments = 0
- Admin menu entries are defined in
etc/adminhtml/menu.xml(including parent underKowal_Base::kowal_modules). - ACL note: this module references ACL resources (
Kowal_CheckoutComment::config,::root,::general) but does not provideetc/acl.xmllocally.
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.phpexists but is not wired inetc/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:upgradefor declarative schema + data patch execution. - Run
php bin/magento setup:di:compilein 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 Commentcolumn.
- Sales order grid contains
- Verify email templates:
order_commentvariable is available (template snippet is provided in README Configuration section).
Deployment Checklist
- Module package installed through Composer.
- Module enabled (
Kowal_CheckoutComment). setup:upgradeexecuted successfully.- DB columns exist in
quote,sales_order,sales_order_grid. - Data patch
AddCheckoutCommentToGridapplied. - 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/basepresent 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 installphp bin/magento module:enable Kowal_CheckoutComment(when not pre-enabled)php bin/magento setup:upgradephp 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
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.