by Firecheckout Support

How to add checkout fields to the order email template?

FireCheckout includes the Checkout Fields module. It makes it possible to show additional fields on the checkout page. Your customers will be able to fill them thereby providing you with the additional information you might require.

With the Checkout Fields module, you can show fields in order email templates. Please follow steps to display extra fields in order emails:

  • Go to Marketing - Communications - Email Templates.
  • Press Add New Template button.
  • Choose the template like a New Order for Guest for instance, and press the Load Template button.
  • In the Template Name field, specify a name for the template.
  • In the Template Content field, place the following code:
{{block class="Swissup\CheckoutFields\Block\Adminhtml\Order\View\Fields" area="frontend" template="Swissup_CheckoutFields::email/order/fields.phtml" order_id=$order.id}}

Note: to show only specific fields, please list the attribute codes in fields_to_show parameter comma-separated:

{{block class="Swissup\CheckoutFields\Block\Adminhtml\Order\View\Fields" area="frontend" template="Swissup_CheckoutFields::email/order/fields.phtml" order_id=$order.idfields_to_show="order_comment,favourite_products,delivery_date"}}
  • Press the Save Template button.
  • Go to Stores - Configuration - Sales - Sales Emails - Order. Select the new template in New Order Confirmation Template for the Guest field.
  • Press Save Config.

Here is the look of the order email with checkout fields.

magento 2 custom checkout fields in email

Recent articles

up