I found almost how the print button is created on the invoice page (invoked from vendor/magento/module-backend/view/adminhtml/templates/widget/button.phtml) with the debug option in Magento2. I would like to add in directly on the order page to avoid going to the invoice page each time. I can't find the exact code that need to be added to my custom adminhtml to add it.

I would like to find how to add the function who generate this code :

<button id="print" title="Print" type="button" class="action-default scalable print" onclick="setLocation('MAGENTO_URL/admin/sales/order_invoice/print/invoice_id/ID/')" data-ui-id="sales-invoice-view-print-button">

If possible to add like after the view link or as a button on the order information tab since I already have some custom code for this page:

tab invoice

Thanks in advance

  • you want to add custom button into invoice grid ? Aug 9, 2020 at 18:31
  • Can be nice like the view one in the action column. A button can work too in a new column.
    – nlegall
    Aug 9, 2020 at 18:33
  • It is possible add image. you what want to Aug 9, 2020 at 18:35
  • I added some details about where I want to add the code
    – nlegall
    Aug 9, 2020 at 18:41
  • Please share your action columns code Aug 9, 2020 at 18:57

1 Answer 1


I managed to get it working using some code provide from another post: How to Add a Custom Button to Admin Sales Order View in Magento2.

Didn't find for the action link but working for adding a new button.

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.