Shopping cart

How to add comments into the email order confirmations

How to add commnets into the email order confirmations

In order to add the comments that customers insert at the One Step Checkout page into the Email order confirmations, stores’ admin need to do the following steps:

Step 1: Get the order attribute code

  • For the Comment field, we set the attribute code is osc_order_comment

Step 2: Create the email templates

  • Go to Marketing > Communications > Email Template, choose Add New Template (or Edit Template)

order attribute 1

  • Load Email New Order Templates

order attribute2

  • Insert the Order Attribute into Template at any place following this codes:
{{depend order.getOscOrderComment()}}
     <p>{{var order.getOscOrderComment() |raw}}</p>
{{\depend}}
  • Depend tag is used to check whether that attribute is empty or not. If it is empty, the html part will be obmitted.
  • OscOrderComment is the capital words of each Attribute code.

Step 3: Apply the email templates that has been created.

  • Navigate to Stores > Settings > Configuration, choose tab Sales > Sales Emails

  • In New Order Confirmation Template, choose Email Template that you have created.

order attribute3

Step 4: Check the emails again

  • Enable customers to Place Order at Frontend
  • Allow to check the emails that customers received from your stores.

order attribute4





Back Ask a question