Display Magento order comments in print.phtml (customers prinable order)

Display Magento order comments in print.phtml (customers prinable order)

July 8, 2026 · Illustrated author avatarBy Stefan Bogdanescu
Display Magento order comments in print.phtml (customers prinable order)

Displaying Magento Order Comments on Customer Printable Orders

You’re not alone if you’ve found yourself wondering how to show order comments on your customers’ printable orders in Magento. It’s a common requirement for businesses that need to provide their customers with more detailed information about their orders.

Understanding the Current Setup

First, let’s clarify what you currently have:

  1. You’re using an extension (Mageworx Order Comments Extension) to allow order comments on your order pages and in order emails.
  2. The comments are successfully displayed in the order email but not on the customer’s printable order page.

Where to Make Changes

You’ve identified the correct file where you need to make changes:

/public_html/app/design/frontend/default/mytemplate/template/sales/order/print.phtml

This is a template file that Magento uses to generate your customers’ printable orders. To display the comments, we’ll need to add some code here.

Retrieving and Displaying the Comments

To display the order comments in the print.phtml file, you can use the following steps:

  1. Get the order object using the current order ID.
  2. Retrieve the customer comment from the order model.
  3. Print the comment in your template.

Here’s an example of how to achieve this:

<?php
$order = Mage::getModel('sales/order')->loadByIncrementId($this->getOrder()->getIncrementId());
if ($order->getCustomerNoteNotify() && $order->getCustomerNote()) {
    echo '<strong>Customer Comment:</strong><br />';
    echo nl2br($order->getCustomerNote());
}
?>

This code checks if the order has a customer note and if the customer is to be notified about it. If both conditions are true, it retrieves the comment using getCustomerNote() and prints it with proper formatting.

Proper Code Integration

To integrate this code into your print.phtml file, find the section where you want to display the comments. It’s usually near the bottom of the file, just above the closing PHP tags (?>).

Paste the provided code snippet here. Make sure that it is properly indented and follows the existing coding style in your theme.

Testing Your Changes

After making these changes, flush Magento’s cache to ensure the new comments are displayed:

  1. Log into the admin panel.
  2. Navigate to the “System” menu > “Cache Management.”
  3. Click the “Flush Cache Storage” button.

Now, when a customer views their printable order, they should see the comments you’ve added using this extension.

Conclusion

Displaying order comments on Magento’s customers’ printable orders is an essential feature for many businesses. By following these steps and adding the provided code to your print.phtml file, you can seamlessly integrate order comments into your customers’ printable documents.

Remember that customizing templates requires a basic understanding of PHP and Magento’s template system. If you’re unsure about any part of this process, don’t hesitate to consult with a Magento developer or reach out to the extension provider for assistance.

At Laravel Company, we specialize in helping businesses optimize their e-commerce platforms for better customer experiences. Feel free to explore our Magento development services for expert assistance with your store’s requirements.

Database Extensions Themes Email

Our network