Skip to content

friends-of-hyva/magento2-hyva-checkout-order-comment-to-email

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 

Repository files navigation

Musicworld Hyvä Checkout Customer Comment Module

Overview

The Musicworld_HyvaCheckoutOrderCommentToEmail module captures and saves customer comments from the checkout process in Magento 2. When a customer leaves a comment on their order, this module ensures the comment is added to the order as a customer note, which can be visible on the frontend if configured as such.

Requirements

  • Magento 2.4.x or higher
  • PHP 7.4 or higher
  • Hyvä Themes checkout integration

Installation

Composer Installation

  1. Add the module to your Magento installation via Composer:

    composer config repositories.friends-of-hyva vcs https://github.com/friends-of-hyva/magento2-hyva-checkout-order-comment-to-email.git
    composer require musicworld/hyva-checkout-order-comment-to-email
  2. Run the following Magento commands to enable and set up the module:

    bin/magento module:enable Musicworld_HyvaCheckoutOrderCommentToEmail
    bin/magento setup:upgrade
    bin/magento cache:flush

Manual Installation

  1. Clone the repository to your Magento app/code directory:

    git clone https://github.com/friends-of-hyva/magento2-hyva-checkout-order-comment-to-email.git app/code/Musicworld/HyvaCheckoutCustomerComment
  2. Enable and set up the module:

    bin/magento module:enable Musicworld_HyvaCheckoutOrderCommentToEmail
    bin/magento setup:upgrade
    bin/magento cache:flush

Usage

This module listens to the sales_order_status_history_save_after event and checks if the status history entry has the is_customer_comment flag set. If so, the comment is saved as a customer note on the order.

Usage Example

To display the customer note in the mail template, you can use the following code:

{{depend order.getCustomerNote()}}
    Comments:
    {{var order.getCustomerNote()}}
{{/depend}}

About

Adds the Customer Comment to customer_note field

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages