Magento – How to add header and footer at sales order print page

blockslayoutmagento-2.1sales

I think by not mentioning magento version I made a mistake. This question is related to Magento 2.1.5

I need specific answer regarding

How to add header and footer at sales order print page? i.e.  /sales/order/print/order_id/3/

I have tried but being fresh at magento don't know how and where to add header and footer blocks in xml file.

Immediate help/guideline is required.

Best Answer

Inside your page.xml find the main structure tag named print. There you can see no header section added there as default handler has.

copy the whole header block from default handler to print handler. There you will see only

<block type="page/html_header" name="header" as="header"/> in print handler.

Now after adding the whole header block in print handler you need to go to app\design\frontend\rwd\default\template\page\print.phtml and add <?php echo $this->getChildHtml('header') ?> after body class.

Now you are done. It will look like this

enter image description here

Hope you have got the idea about footer also. Enjoy !!

Related Topic