1

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

0

You can try to use

<referenceBlock name="additional.product.info">
 <block class="Magento\Framework\View\Element\Template"
                   name="order.comment"
                   template="Namespace_Sales::order/order_comment.phtml"
                   cacheable="false" />

</referenceBlock>

as below is the code for comment xml

<block class="Magento\Framework\View\Element\Template" name="additional.product.info" template="Magento_Theme::template.phtml"/>
15
  • 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 May 4 '20 at 12:54
  • pls let me know on this May 5 '20 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 May 5 '20 at 6:08
  • im use in core file, how can i did this in core? May 5 '20 at 6:10
  • Can you please paste your code here what you are doing? May 5 '20 at 6:10

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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