display “print pdf” button on order view page in admin panel [closed]
-
12-12-2019 - |
Domanda
In magento admin panel, on invoice view page, we can see there is "print pdf" option.
we want to display "print pdf" on order view page.
Soluzione
you have to loop on the invoice collection of your order (even if you have just one invoice per order, Magento store a 1-* relation).
And for each invoice generate the link.
I let you theme as you want.
$adminHelper = Mage::helper("adminhtml");
foreach ($order->getInvoiceCollection() as $invoice) {
$printInvoiceUrl = $adminHelper->getUrl('adminhtml/sales_order_invoice/print', array('invoice_id' => $invoice->getId());
//render your button
}
Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a magento.stackexchange