Magento – magento 2 edit customer HTML print order

invoicemagento-2.1print

In the client dashboard>My Orders>View Order there is a print order option.

The file vendor\magento\module-sales\view\frontend\templates\order\items.phtml generates the output. But any changes I make to this file changes all pages using the file. Can I create a file so that only the print order url ( generated by <?php echo $block->getPrintUrl($_order) ?>) will use its own file?

Or can I create a new link to a new file so I can edit just the print order output?

Best Answer

in a template .phtml are hooked with blocks. If you need it for some specific page then the way suggested is 1. In layout handle add a new block. 2. Associate a .phtml 3. remove block.

with this in mind now copy existing .phtml and create a new .phtme with needed specific changes. So find out the handle for the URL you want changed layout and use above provided hints.

Related Topic