im new in magento 2, im work on print order to print order comment when we do print order from front end,

My Orders->Print Order

when we click on Print Order the same comment print on PDF

as per the below image. so how can we print that comment on Order PDF?

enter image description here

1 Answer 1


You can try to use

<referenceBlock name="additional.product.info">
 <block class="Magento\Framework\View\Element\Template"
                   cacheable="false" />


as below is the code for comment xml

<block class="Magento\Framework\View\Element\Template" name="additional.product.info" template="Magento_Theme::template.phtml"/>
  • Fatal error: Uncaught Error: Call to a member function getVisibleStatusHistory() on null in vendor/magento/module-sales/view/frontend/templates/order/order_comments.phtml:9 its give me this error
    – rocky9310
    Commented May 4, 2020 at 12:54
  • pls let me know on this
    – rocky9310
    Commented May 5, 2020 at 5:27
  • You need to use your block instead of Magento\Framework\View\Element\Template and call the order object. or you can use viewModel Commented May 5, 2020 at 6:08
  • im use in core file, how can i did this in core?
    – rocky9310
    Commented May 5, 2020 at 6:10
  • Can you please paste your code here what you are doing? Commented May 5, 2020 at 6:10

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.