cancel
Showing results for 
Search instead for 
Did you mean: 

I am getting almost blank page on magento print order

I am getting almost blank page on magento print order

When I try to print an order from frontend customer account, the print layout is almost empty without any data. then I click on cancel and choose to print again and it shows fine.

 

I am using Magento 2.2.2 Open Source

 

Steps to reproduce:

  • Log in as a customer
  • Go to "My account" page on frontend
  • Click on your order
  • Click "Print Order"

Has someone else encountered this problem and fixed it?

I have found a solution on google, but not sure how to implement it since could not find where to write the code fix.

the suggestion was to call the print option after the page is loaded, with this code:

<script>
    require(
        [
            'jquery'
        ],
        function($) {
            $(function() {
                window.print();
            });
        }
    );
</script>
1 REPLY 1

Re: I am getting almost blank page on magento print order

@robertbits 

You can use the below location to place a code:

vendor\magento\module-theme\view\frontend\templates\html\print.phtml
Problem solved? Click Kudos and "Accept as Solution".
200+ Magento 2 Extensions for Enhanced Shopping Experience.